From ec111ce03b552a5593f00b42ea5a6daf30718483 Mon Sep 17 00:00:00 2001 From: Enrico Gruner Date: Sun, 3 Nov 2024 22:56:43 +0100 Subject: [PATCH] fix possibly leaking eventlisteners --- src/components/dialog/dialog.component.ts | 2 +- src/components/drawer/drawer.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/dialog/dialog.component.ts b/src/components/dialog/dialog.component.ts index 0d6c5505de..54f62d0275 100644 --- a/src/components/dialog/dialog.component.ts +++ b/src/components/dialog/dialog.component.ts @@ -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') { diff --git a/src/components/drawer/drawer.component.ts b/src/components/drawer/drawer.component.ts index 1936514315..21d4207fff 100644 --- a/src/components/drawer/drawer.component.ts +++ b/src/components/drawer/drawer.component.ts @@ -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') {