fix possibly leaking eventlisteners (#2257)

This commit is contained in:
Enrico Gruner
2024-11-04 21:51:19 +01:00
committed by GitHub
parent b70fa163e1
commit 569acdb7c9
2 changed files with 2 additions and 2 deletions

View File

@@ -114,7 +114,7 @@ export default class SlDialog extends ShoelaceElement {
super.disconnectedCallback();
this.modal.deactivate();
unlockBodyScrolling(this);
this.closeWatcher?.destroy();
this.removeOpenListeners();
}
private requestClose(source: 'close-button' | 'keyboard' | 'overlay') {

View File

@@ -131,7 +131,7 @@ export default class SlDrawer extends ShoelaceElement {
disconnectedCallback() {
super.disconnectedCallback();
unlockBodyScrolling(this);
this.closeWatcher?.destroy();
this.removeOpenListeners();
}
private requestClose(source: 'close-button' | 'keyboard' | 'overlay') {