Skip to content

Commit

Permalink
fix: properly remove event listeners in Component's removeEventListener
Browse files Browse the repository at this point in the history
  • Loading branch information
ovx committed Oct 10, 2024
1 parent 484588a commit e6d428e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/svelte/src/runtime/internal/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit e6d428e

Please sign in to comment.