-
Describe the bugI have an sl-dialog containing a copy of sl-copy-buttons; I need to intercept the sl-copy event on those, so I add the listener on buttons when dialog's "sl-after-show" event fires*. It works, but as soon as I move the mouse over the copy button, another "sl-show" or "sl-after-show" fires, and the copy button loses the listener I've added.
To Reproduce
Browser / OS
Additional informationEvents on sl-copy-button works normally outside a sl-dialog |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
It's likely you're seeing the events from the copy button's tooltip. This is a common pitfall of events, as they're not unique to the component (think of how the standard I've written about this and suggested some ways to solve it in this post: https://www.abeautifulsite.net/posts/custom-event-names-and-the-bubbling-problem/ |
Beta Was this translation helpful? Give feedback.
-
My bad absolutely, my root problem (loosing the event on sl-copy) was me doing bad things :( Sorry for wasting your time. |
Beta Was this translation helpful? Give feedback.
-
Closing this |
Beta Was this translation helpful? Give feedback.
It's likely you're seeing the events from the copy button's tooltip. This is a common pitfall of events, as they're not unique to the component (think of how the standard
click
event works).I've written about this and suggested some ways to solve it in this post:
https://www.abeautifulsite.net/posts/custom-event-names-and-the-bubbling-problem/