File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
packages/svelte/src/internal/client/dom/elements Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' svelte ' : patch
3
+ ---
4
+
5
+ fix: prevent last_propagated_event from being DCE'd
Original file line number Diff line number Diff line change @@ -168,8 +168,11 @@ export function handle_event_propagation(event) {
168
168
// mounted apps. In this case we don't want to trigger events multiple times.
169
169
var path_idx = 0 ;
170
170
171
+ // the `last_propagated_event === event` check is redundant, but
172
+ // without it the variable will be DCE'd and things will
173
+ // fail mysteriously in Firefox
171
174
// @ts -expect-error is added below
172
- var handled_at = event . __root ;
175
+ var handled_at = last_propagated_event === event && event . __root ;
173
176
174
177
if ( handled_at ) {
175
178
var at_idx = path . indexOf ( handled_at ) ;
You can’t perform that action at this time.
0 commit comments