Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions core/src/components/menu/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,16 @@ export class Menu implements ComponentInterface, MenuI {
this.updateState();
}

disconnectedCallback() {
async disconnectedCallback() {
/**
* The menu should be closed when it is
* unmounted from the DOM.
* This is an async call, so we need to wait for
* this to finish otherwise contentEl
* will not have MENU_CONTENT_OPEN removed.
*/
await this.close(false);

this.blocker.destroy();
menuController._unregister(this);
if (this.animation) {
Expand All @@ -246,7 +255,7 @@ export class Menu implements ComponentInterface, MenuI {
}

this.animation = undefined;
this.contentEl = this.backdropEl = this.menuInnerEl = undefined;
this.contentEl = undefined;
}

@Listen('ionSplitPaneVisible', { target: 'body' })
Expand Down