mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
fix popup
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user