Skip to content

Commit 3e9c407

Browse files
Seldaekvkbansal
authored andcommitted
Fix submenu closing whenever an unrelated contextmenu is being hidden (#222)
1 parent b270933 commit 3e9c407

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/SubMenu.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,12 @@ export default class SubMenu extends AbstractMenu {
151151
return position;
152152
}
153153

154-
hideMenu = () => {
154+
hideMenu = (e) => {
155+
// avoid closing submenus of a different menu tree
156+
if (e.detail && e.detail.id && this.menu && e.detail.id !== this.menu.id) {
157+
return;
158+
}
159+
155160
if (this.props.forceOpen) {
156161
this.props.forceClose();
157162
}

0 commit comments

Comments
 (0)