Skip to content

Commit e6d428e

Browse files
committed
fix: properly remove event listeners in Component's removeEventListener
1 parent 484588a commit e6d428e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/svelte/src/runtime/internal/Component.js

+6
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,12 @@ if (typeof HTMLElement === 'function') {
220220
this.$$l_u.delete(listener);
221221
}
222222
}
223+
if (this.$$l[type]) {
224+
const idx = this.$$l[type].indexOf(listener);
225+
if (idx >= 0) {
226+
this.$$l[type].splice(idx, 1);
227+
}
228+
}
223229
}
224230

225231
async connectedCallback() {

0 commit comments

Comments
 (0)