From c1aab56552c4e110a0510a5a2fe57683bed0afd8 Mon Sep 17 00:00:00 2001 From: konnorrogers Date: Thu, 19 Dec 2024 13:47:11 -0500 Subject: [PATCH] fix popup --- src/components/popup/popup.ts | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/components/popup/popup.ts b/src/components/popup/popup.ts index f08717b9c..f404c2356 100644 --- a/src/components/popup/popup.ts +++ b/src/components/popup/popup.ts @@ -283,6 +283,9 @@ export default class WaPopup extends WebAwesomeElement { return; } + // Should this only be for `strategy="fixed"`? (hoist in most components) + if (SUPPORTS_POPOVER) { this.popup.showPopover() } + this.cleanup = autoUpdate(this.anchorEl, this.popup, () => { this.reposition(); }); @@ -290,6 +293,8 @@ export default class WaPopup extends WebAwesomeElement { private async stop(): Promise { return new Promise(resolve => { + if (SUPPORTS_POPOVER) { this.popup.hidePopover() } + if (this.cleanup) { this.cleanup(); this.cleanup = undefined; @@ -579,19 +584,6 @@ export default class WaPopup extends WebAwesomeElement { `; } - - @watch('active') - handleActiveChange() { - if (!SUPPORTS_POPOVER || !this.popup) { - return; - } - - if (this.active) { - this.popup.showPopover(); - } else { - this.popup.hidePopover(); - } - } } declare global {