Skip to content

Commit

Permalink
fix: remove hoisted menu-surface from body in onDestroy
Browse files Browse the repository at this point in the history
  • Loading branch information
hperrin committed Nov 7, 2019
1 parent fee2755 commit 8e905b7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/menu-surface/MenuSurface.svelte
Expand Up @@ -95,8 +95,15 @@
if (anchor) {
element && element.parentNode.classList.remove('mdc-menu-surface--anchor');
}
let isHoisted = false;
if (menuSurface) {
isHoisted = menuSurface.foundation_.isHoistedElement_;
}
if (instantiate !== false) {
menuSurface && menuSurface.destroy()
menuSurface.destroy();
}
if (isHoisted) {
element.parentNode.removeChild(element);
}
});
Expand Down

0 comments on commit 8e905b7

Please sign in to comment.