Skip to content

Instantly share code, notes, and snippets.

@joshyu
Last active August 16, 2021 01:40
Show Gist options
  • Save joshyu/4685744849c1889b80a3c6156197ba2f to your computer and use it in GitHub Desktop.
Save joshyu/4685744849c1889b80a3c6156197ba2f to your computer and use it in GitHub Desktop.

Revisions

  1. joshyu revised this gist Aug 5, 2021. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,3 @@
    When we want to detect which internal component we are clicking on some webcomponent,we can use **event.composed** to check whether the event is broadcasted through a webcomponent, and then check the array list returned from **event.composedPath()** to look up the DOM, if found then we can confirm we are clicking on the specified DOM node and do some specific things.
    When we want to detect which internal component we are clicking on some webcomponent,we can use **event.composed** to check whether the event is broadcasted through a webcomponent, and then check the array list returned from **event.composedPath()** to look up the DOM, if found then we can confirm we are clicking on the specified DOM node and do some specific things.

    https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath
  2. joshyu revised this gist Aug 5, 2021. No changes.
  3. joshyu revised this gist Aug 5, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    When we want to detect which internal component we are clicking on some webcomponent,we can use **event.composed** to check whether the event is broadcasted through a webcomponent, and then check the array list returned from **event.composedPath** to look up the DOM, if found then we can confirm we are clicking on the specified DOM node and do some specific things.
    When we want to detect which internal component we are clicking on some webcomponent,we can use **event.composed** to check whether the event is broadcasted through a webcomponent, and then check the array list returned from **event.composedPath()** to look up the DOM, if found then we can confirm we are clicking on the specified DOM node and do some specific things.
  4. joshyu revised this gist Aug 5, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    When we want to detect which internal component we are clicking on some webcomponent,we can use *event.composed* to check whether the event is broadcasted through a webcomponent, and then check the array list returned from *event.composedPath* to look up the DOM, if found then we can confirm we are clicking on the specified DOM node and do some specific things.
    When we want to detect which internal component we are clicking on some webcomponent,we can use **event.composed** to check whether the event is broadcasted through a webcomponent, and then check the array list returned from **event.composedPath** to look up the DOM, if found then we can confirm we are clicking on the specified DOM node and do some specific things.
  5. joshyu created this gist Aug 5, 2021.
    1 change: 1 addition & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    When we want to detect which internal component we are clicking on some webcomponent,we can use *event.composed* to check whether the event is broadcasted through a webcomponent, and then check the array list returned from *event.composedPath* to look up the DOM, if found then we can confirm we are clicking on the specified DOM node and do some specific things.