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
Using bind:this on a element will break the bubbleing behavior for every child element down the DOM tree.
Any stopPropagation() triggers on an event in a child element will not stop correctly the propagation of the event and the parent will then still receive the event.
After a little investigation, it does not seem to come from the new way of attaching the events onevent instead of on:event neither having the runes mode on.
Something weird is really happening with the bind:this feature.
Reproduction
Here's the bug reproduction REPL on Svelte 5
The same thing running correctly with Svelte 4
Expected behavior: Click on the div with red border on Svelte 5 should not trigger the parent event because the propagation was stopped in the child.
Logs
No log
System Info
N/A
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered:
chainlist
changed the title
Svelte 5: Attaching an event to a tag with bind:this breaks the bubble behavior
Svelte 5: Attaching an event to a element with bind:this breaks the bubbling phase of events
Nov 28, 2023
chainlist
changed the title
Svelte 5: Attaching an event to a element with bind:this breaks the bubbling phase of events
Svelte 5: Attaching an event to a element with bind:this prevents any child to stop the propagation of an event to its parents
Nov 28, 2023
chainlist
changed the title
Svelte 5: Attaching an event to a element with bind:this prevents any child to stop the propagation of an event to its parents
Svelte 5: bind:this prevents any child from stopping the propagation of an event to its parents
Nov 28, 2023
Describe the bug
Hello,
Discovered a bug on svelte 5 with the
bind:this
.Using
bind:this
on a element will break the bubbleing behavior for every child element down the DOM tree.Any
stopPropagation()
triggers on an event in a child element will not stop correctly the propagation of the event and the parent will then still receive the event.After a little investigation, it does not seem to come from the new way of attaching the events
onevent
instead ofon:event
neither having the runes mode on.Something weird is really happening with the
bind:this
feature.Reproduction
Here's the bug reproduction REPL on Svelte 5
The same thing running correctly with Svelte 4
Expected behavior: Click on the div with red border on Svelte 5 should not trigger the parent event because the propagation was stopped in the child.
Logs
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: