From 440bd68ef9c00a8050f3b098ee5e45b777706b72 Mon Sep 17 00:00:00 2001 From: Enrico Gruner Date: Mon, 4 Nov 2024 00:22:25 +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') {