fix: ensure event.target is correct for delegation (#11900)

pull/11904/head
Dominic Gannaway 4 weeks ago committed by GitHub
parent 33f83302bf
commit 03945bd9bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: ensure event.target is correct for delegation

@ -113,13 +113,6 @@ export function handle_event_propagation(handler_element, event) {
var path = event.composedPath?.() || [];
var current_target = /** @type {null | Element} */ (path[0] || event.target);
if (event.target !== current_target) {
define_property(event, 'target', {
configurable: true,
value: current_target
});
}
// composedPath contains list of nodes the event has propagated through.
// We check __root to skip all nodes below it in case this is a
// parent of the __root node, which indicates that there's nested

Loading…
Cancel
Save