Skip to content

Commit 586dc46

Browse files
committed
fix: menu click not trigger #1470
1 parent 16ec40a commit 586dc46

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

components/vc-menu/SubPopupMenu.jsx

+6-7
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ 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;
312311
const newChildProps = {
313312
props: {
314313
mode: childProps.mode || props.mode,
@@ -334,12 +333,12 @@ const SubPopupMenu = {
334333
...extraProps,
335334
},
336335
on: {
337-
click: isSubMenu
338-
? noop
339-
: e => {
340-
(childListeners.click || noop)(e);
341-
this.onClick(e);
342-
},
336+
click: e => {
337+
if ('keyPath' in e) {
338+
(childListeners.click || noop)(e);
339+
this.onClick(e);
340+
}
341+
},
343342
itemHover: this.onItemHover,
344343
openChange: this.onOpenChange,
345344
deselect: this.onDeselect,

0 commit comments

Comments
 (0)