You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
handle_event_propagation breaks due to fact that delegate is an array #17057
the event is added inside of a web component created with svelte >= v5.42.3
and also from another bundle which renders the webcomponent with svelte < 5.42.3 (propbably).
so something like this:
<my-elementonclick={()=>console.log("hi")}>
Where "my-element" is a web-component created with svelte
In this case the call to
delegate.call()
breaks with error "delegate.call is not a function"
Reproduction
Create a webcomponent with latest svelte, which also binds a "click" event to its "host" element, and bundle it.
Create a svelte app which uses the webcomponent and use onclick to bind the event on the custom-element.
Click on the element
Error arises.
Logs
System Info
Latest Chrome, Edge, Firefox, Safari
Severity
blocking an upgrade
Reacted by Tino Prahl, Philipp Möhler, David Fischer, Erik Nogueira Kückelheim, Christian Haller, DimeloTony and Philipp Möhler
Generally we don't support when things are compiled with multiple versions but this is exempt from that because it's compiled as a custom element.
I guess we need to make it a) backwards compatible somehow at least for Svelte 5 b) somehow mark delegated events of web components such that they don't partake in that delegation, or don't use event delegation at all in custom element builds
Reacted by Tino Prahl, Christian Haller and Eric Wohlgethan
We will definetely upgrade the version across all apps, but it takes time, so it would be cool, if the handling of event list could be returned for next 2-3 versions
Activity
dummdidumm commentedon Oct 28, 2025
Generally we don't support when things are compiled with multiple versions but this is exempt from that because it's compiled as a custom element.
I guess we need to make it a) backwards compatible somehow at least for Svelte 5 b) somehow mark delegated events of web components such that they don't partake in that delegation, or don't use event delegation at all in custom element builds
jurijzahn8019 commentedon Oct 29, 2025
We will definetely upgrade the version across all apps, but it takes time, so it would be cool, if the handling of event list could be returned for next 2-3 versions
fix: robustify custom elements event handling
fix: use symbols for encapsulated event delegation (#17703)