muxinc / media-chrome

Custom elements (web components) for making audio and video player controls that look great in your website or app.
https://media-chrome.org
MIT License
1.21k stars 62 forks source link

Adding slotted content to media-settings-menu-item disables click event #814

Closed moaali closed 7 months ago

moaali commented 7 months ago

When adding a custom html content using slots to media-settings-menu-item, click event for this item stops working when clicking on any of the added elements, and only works if the click is inside the item and OUTSIDE the elements for that item, for example if you clicked on the 1x in the image below click works as expected but if you clicked on S letter or Speed or >> click will not work.

Steps to reproduce

Replace Speed word in media-settings-menu-item with this code:

<i slot="prefix" style="padding: 5px; background: red;">S</i>
<button style="padding: 5px; background: magenta;">Speed</button>
<i slot="suffix" style="padding: 5px; background: green;">>>></i>

Expected behavior

When clicking on any element inside media-settings-menu-item click event should be working normally.

Actual behavior

Click event not firing when clicking any of the slotted elements.

Screenshot 2024-02-12 at 1 28 46 PM