fix popup

This commit is contained in:
konnorrogers
2024-12-19 13:47:11 -05:00
parent f7d99e58f8
commit c1aab56552

View File

@@ -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<void> {
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 {
</div>
`;
}
@watch('active')
handleActiveChange() {
if (!SUPPORTS_POPOVER || !this.popup) {
return;
}
if (this.active) {
this.popup.showPopover();
} else {
this.popup.hidePopover();
}
}
}
declare global {