fix: properly remove event listeners in Component's removeEventListener (v4) (#13556)

* fix: properly remove event listeners in Component's removeEventListener

* changeset

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>
pull/15965/head
Daniel Regeci 4 months ago committed by GitHub
parent 6045028666
commit 8286164143
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: properly remove event listeners in Component's removeEventListener

@ -220,6 +220,12 @@ if (typeof HTMLElement === 'function') {
this.$$l_u.delete(listener);
}
}
if (this.$$l[type]) {
const idx = this.$$l[type].indexOf(listener);
if (idx >= 0) {
this.$$l[type].splice(idx, 1);
}
}
}
async connectedCallback() {

Loading…
Cancel
Save