New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When clicking an element within a shadow DOM, use it as the target instead of the shadow root #544
When clicking an element within a shadow DOM, use it as the target instead of the shadow root #544
Conversation
This pull request has been mentioned on Matomo forums. There might be relevant details there: https://forum.matomo.org/t/event-tracking-inside-webcomponents-shadowdom/47205/2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully tested this change and it looks good to me. Any concerns @AltamashShaikh ?
@snake14 Changes look good, but we need to add this in other click triggers too |
Is it going to work in older browsers? |
@justinvelluppillai That's a good point. According to Can I use, it's supported by pretty much all newer browsers. So, it doesn't look like it would work for IE or some older browsers. Is that a deal breaker? |
This line of code would just need to not run and not break or error for older browsers, so just making sure it's adequately handling that is the key. |
@justinvelluppillai I would expect |
Thanks for the discussions. Yes I also was thinking of an enhancement for other relevant triggers (like mentioned by @AltamashShaikh ) Since the AllDownloadsClickTrigger the clickCallBack has advanced implementation I do not feel experienced enough with the needed code change. Maybe someone else.... :-) |
As mentioned by @AltamashShaikh I have added the code change (to deal with the target element inside shadow dom) to |
Hhhm, any idea why 1 build job failed? |
@multikoop Yep. It looks like there was a random server error during one of the specific builds. I restarted it and it ran successfully this time. It's all good now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@multikoop Left 1 minor comment to make code more readable
@multikoop Thank you for your contribution, your changes should go live with release of Matomo 4.12 |
Thanks for the discussion and accepting the contribution. Looking forward to the release 🤩 |
Description:
This code change enhances the AllElementsClickedTrigger to fire event on the actual clicked target when inside an (open) shadow dom.
Fixes: #543
Review