fix: delegate events on elements with bind-this (#9696)

fixes #9688
pull/9715/head
Simon H 1 year ago committed by GitHub
parent 2416587215
commit 1fe0152dd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: delegate events on elements with bind-this

@ -1106,7 +1106,8 @@ function determine_element_spread_and_delegatable(node) {
has_spread = true;
} else if (
!has_action_or_bind &&
(attribute.type === 'BindDirective' || attribute.type === 'UseDirective')
((attribute.type === 'BindDirective' && attribute.name !== 'this') ||
attribute.type === 'UseDirective')
) {
has_action_or_bind = true;
}

Loading…
Cancel
Save