From adad60e93346974ff3409a0aa7f19e9d9471151f Mon Sep 17 00:00:00 2001 From: tanjinzhou <415800467@qq.com> Date: Wed, 17 Jun 2020 19:50:22 +0800 Subject: [PATCH] fix: menu --- components/vc-menu/SubPopupMenu.jsx | 3 ++- components/vc-menu/util.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/vc-menu/SubPopupMenu.jsx b/components/vc-menu/SubPopupMenu.jsx index 7c4d338d1..5c83a664e 100644 --- a/components/vc-menu/SubPopupMenu.jsx +++ b/components/vc-menu/SubPopupMenu.jsx @@ -4,7 +4,7 @@ import { connect } from '../_util/store'; import BaseMixin from '../_util/BaseMixin'; import KeyCode from '../_util/KeyCode'; import classNames from 'classnames'; -import { getKeyFromChildrenIndex, loopMenuItem, noop, isMobileDevice } from './util'; +import { getKeyFromChildrenIndex, loopMenuItem, noop, isMobileDevice, menuAllProps } from './util'; import DOMWrap from './DOMWrap'; import { cloneElement } from '../_util/vnode'; import { initDefaultProps, getOptionProps, getComponent, splitAttrs } from '../_util/props-util'; @@ -342,6 +342,7 @@ const SubPopupMenu = { this.instanceArray = []; this.instanceArrayKeyIndexMap = {}; const className = classNames(props.class, props.prefixCls, `${props.prefixCls}-${props.mode}`); + menuAllProps.forEach(key => delete props[key]); // Otherwise, the propagated click event will trigger another onClick delete onEvents.onClick; const domWrapProps = { diff --git a/components/vc-menu/util.js b/components/vc-menu/util.js index 353c46e12..1b60c91ca 100644 --- a/components/vc-menu/util.js +++ b/components/vc-menu/util.js @@ -109,6 +109,7 @@ export const menuAllProps = [ 'onTitleMouseenter', 'onTitleMouseleave', 'onTitleClick', + '__propsSymbol__', ]; // ref: https://github.com/ant-design/ant-design/issues/14007