Skip to content

Commit 177eaa9

Browse files
authored
Merge pull request #80 from eddiew/master
fix: Cannot read property 'destroy' of undefined in menuSurface
2 parents b78d2ca + 2bd8d37 commit 177eaa9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/menu-surface/MenuSurface.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@
101101
let isHoisted = false;
102102
if (menuSurface) {
103103
isHoisted = menuSurface.foundation_.isHoistedElement_;
104-
}
105-
if (instantiate !== false) {
106-
menuSurface.destroy();
104+
if (instantiate !== false) {
105+
menuSurface.destroy();
106+
}
107107
}
108108
if (isHoisted) {
109109
element.parentNode.removeChild(element);
@@ -156,4 +156,4 @@
156156
export function getDefaultFoundation(...args) {
157157
return menuSurface.getDefaultFoundation(...args);
158158
}
159-
</script>
159+
</script>

0 commit comments

Comments
 (0)