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 {