8000 fix: properly remove event listeners in Component's removeEventListener (v4) by ovx · Pull Request #13556 · sveltejs/svelte · GitHub
[go: up one dir, main page]

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 20, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: properly remove event listeners in Component's removeEventListener
  • Loading branch information
ovx committed Oct 10, 2024
commit e6d428eb093051bfd634ed50c094569595f3d90b
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