Skip to content

Commit 910a62e

Browse files
committed
fix: submenu trigger double click event #1450
1 parent 5d17c7f commit 910a62e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

components/vc-menu/SubPopupMenu.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ const SubPopupMenu = {
308308
this.instanceArrayKeyIndexMap[key] = Object.keys(this.instanceArrayKeyIndexMap).length;
309309
}
310310
const childListeners = getEvents(child);
311+
const isSubMenu = child.componentOptions && child.componentOptions.Ctor.options.isSubMenu;
311312
const newChildProps = {
312313
props: {
313314
mode: childProps.mode || props.mode,
@@ -333,10 +334,12 @@ const SubPopupMenu = {
333334
...extraProps,
334335
},
335336
on: {
336-
click: e => {
337-
(childListeners.click || noop)(e);
338-
this.onClick(e);
339-
},
337+
click: isSubMenu
338+
? noop
339+
: e => {
340+
(childListeners.click || noop)(e);
341+
this.onClick(e);
342+
},
340343
itemHover: this.onItemHover,
341344
openChange: this.onOpenChange,
342345
deselect: this.onDeselect,

0 commit comments

Comments
 (0)