diff --git a/components/vc-menu/DOMWrap.jsx b/components/vc-menu/DOMWrap.jsx index 54965afae..83d7dc9a0 100644 --- a/components/vc-menu/DOMWrap.jsx +++ b/components/vc-menu/DOMWrap.jsx @@ -112,7 +112,7 @@ const DOMWrap = { // with a title of overflow indicator ('...') const copy = this.$slots.default[0]; const { title, ...rest } = getPropsData(copy); // eslint-disable-line no-unused-vars - + const events = getEvents(copy); let style = {}; let key = `${keyPrefix}-overflowed-indicator`; let eventKey = `${keyPrefix}-overflowed-indicator`; @@ -133,11 +133,17 @@ const DOMWrap = { const popupClassName = theme ? `${prefixCls}-${theme}` : ''; const props = {}; + const on = {}; menuAllProps.props.forEach(k => { if (rest[k] !== undefined) { props[k] = rest[k]; } }); + menuAllProps.on.forEach(k => { + if (events[k] !== undefined) { + on[k] = events[k]; + } + }); const subMenuProps = { props: { title: overflowedIndicator, @@ -149,7 +155,7 @@ const DOMWrap = { class: `${prefixCls}-overflowed-submenu`, key, style, - on: getEvents(copy), + on, }; return {overflowedItems}; @@ -263,7 +269,10 @@ const DOMWrap = { c, // children[index].key will become '.$key' in clone by default, // we have to overwrite with the correct key explicitly - { key: getPropsData(c).eventKey, props: { mode: 'vertical-left' } }, + { + key: getPropsData(c).eventKey, + props: { mode: 'vertical-left' }, + }, ); }); diff --git a/components/vc-menu/SubPopupMenu.jsx b/components/vc-menu/SubPopupMenu.jsx index d101a7dd6..1194ab264 100644 --- a/components/vc-menu/SubPopupMenu.jsx +++ b/components/vc-menu/SubPopupMenu.jsx @@ -337,10 +337,8 @@ const SubPopupMenu = { }, on: { click: e => { - if ('keyPath' in e) { - (childListeners.click || noop)(e); - this.onClick(e); - } + (childListeners.click || noop)(e); + this.onClick(e); }, itemHover: this.onItemHover, openChange: this.onOpenChange,