Skip to content

Commit 52f6d2b

Browse files
committed
fix: ensure event.target is correct for delegation
1 parent 5eb8641 commit 52f6d2b

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

.changeset/hot-cooks-repair.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte": patch
3+
---
4+
5+
fix: ensure event.target is correct for delegation

packages/svelte/src/internal/client/dom/elements/events.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,6 @@ export function handle_event_propagation(handler_element, event) {
113113
var path = event.composedPath?.() || [];
114114
var current_target = /** @type {null | Element} */ (path[0] || event.target);
115115

116-
if (event.target !== current_target) {
117-
define_property(event, 'target', {
118-
configurable: true,
119-
value: current_target
120-
});
121-
}
122-
123116
// composedPath contains list of nodes the event has propagated through.
124117
// We check __root to skip all nodes below it in case this is a
125118
// parent of the __root node, which indicates that there's nested

0 commit comments

Comments
 (0)