Hi @franc_g
You’re definitely not alone in running into this. Shadow DOM introduces some quirks when it comes to event handling, and the click event is one of the trickier ones because of how event retargeting and encapsulation work.
If mouseup is working and click isn’t, it likely comes down to how the Shadow DOM manages event bubbling. click doesn't always bubble through the shadow boundary the way you'd expect, whereas moueup tends to behave more reliably in that regard, especially with custom listeners or tracking layers like Activity Map.
You can do the following -
-
If you control the component, make sure any custom events are fired with composed: true and bubbles: true so they can cross the shadow boundary.
-
If you're just listening from outside and can't modify the component, then sticking with mouseup is a perfectly valid workaround and quite common in shadow-heavy apps.
-
Also worth checking if the component has a click handler that’s stopping propagation. That would explain why your external listener never fires on click, but mouseup sneaks through.
Your current fix using mouseup is solid, and unless you can tweak the component’s internals, it might be the best route.
Hope it works!