Skip to content

Commit 4c3c27a

Browse files
authored
Updated cleanup to exit early when submenu is gone
1 parent 1d7053d commit 4c3c27a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/SubMenu.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export default class SubMenu extends AbstractMenu {
8989
});
9090
} else {
9191
const cleanup = () => {
92+
if (!this.subMenu) return;
9293
this.subMenu.removeEventListener('transitionend', cleanup);
9394
this.subMenu.style.removeProperty('bottom');
9495
this.subMenu.style.removeProperty('right');

0 commit comments

Comments
 (0)