diff --git a/components/layout/__tests__/__snapshots__/demo.test.js.snap b/components/layout/__tests__/__snapshots__/demo.test.js.snap
index 00930a76c..4097d2c63 100644
--- a/components/layout/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/layout/__tests__/__snapshots__/demo.test.js.snap
@@ -75,19 +75,19 @@ exports[`renders ./components/layout/demo/fixed.md correctly 1`] = `
@@ -245,19 +245,19 @@ exports[`renders ./components/layout/demo/top.md correctly 1`] = `
@@ -277,19 +277,19 @@ exports[`renders ./components/layout/demo/top-side.md correctly 1`] = `
@@ -336,19 +336,19 @@ exports[`renders ./components/layout/demo/top-side-2.md correctly 1`] = `
diff --git a/components/menu/__tests__/__snapshots__/demo.test.js.snap b/components/menu/__tests__/__snapshots__/demo.test.js.snap
index 6a226703c..158a139fc 100644
--- a/components/menu/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/menu/__tests__/__snapshots__/demo.test.js.snap
@@ -4,31 +4,31 @@ exports[`renders ./components/menu/demo/horizontal.md correctly 1`] = `
diff --git a/components/vc-menu/DOMWrap.jsx b/components/vc-menu/DOMWrap.jsx
index ec01b2dcc..7f47aeb14 100644
--- a/components/vc-menu/DOMWrap.jsx
+++ b/components/vc-menu/DOMWrap.jsx
@@ -123,24 +123,25 @@ const DOMWrap = {
}
const popupClassName = theme ? `${prefixCls}-${theme}` : ''
+ const props = {}
+ menuAllProps.props.forEach(k => {
+ if (rest[k] !== undefined) {
+ props[k] = rest[k]
+ }
+ })
const subMenuProps = {
props: {
- title,
- overflowedIndicator,
+ title: overflowedIndicator,
popupClassName,
+ ...props,
eventKey: `${keyPrefix}-overflowed-indicator`,
disabled: false,
},
class: `${prefixCls}-overflowed-submenu`,
key,
style,
- on: copy.$listeners,
+ on: copy.componentOptions.listeners,
}
- menuAllProps.props.forEach(k => {
- if (rest[k] !== undefined) {
- subMenuProps.props[k] = rest[k]
- }
- })
return (
lastVisibleIndex) {
item = cloneElement(
diff --git a/components/vc-menu/Menu.jsx b/components/vc-menu/Menu.jsx
index f64e47ae9..253335c2b 100644
--- a/components/vc-menu/Menu.jsx
+++ b/components/vc-menu/Menu.jsx
@@ -158,7 +158,7 @@ const Menu = {
...props,
itemIcon: getComponentFromProp(this, 'itemIcon', props),
expandIcon: getComponentFromProp(this, 'expandIcon', props),
- overflowedIndicator: getComponentFromProp(this, 'overflowedIndicator', props),
+ overflowedIndicator: getComponentFromProp(this, 'overflowedIndicator', props) || ···,
openTransitionName: this.getOpenTransitionName(),
parentMenu: this,
children: filterEmpty(this.$slots.default || []),
diff --git a/components/vc-menu/SubPopupMenu.jsx b/components/vc-menu/SubPopupMenu.jsx
index 52d4e28be..6c4352ac3 100644
--- a/components/vc-menu/SubPopupMenu.jsx
+++ b/components/vc-menu/SubPopupMenu.jsx
@@ -99,6 +99,7 @@ const SubPopupMenu = {
manualRef: PropTypes.func,
itemIcon: PropTypes.any,
expandIcon: PropTypes.any,
+ overflowedIndicator: PropTypes.any,
children: PropTypes.any.def([]),
__propsSymbol__: PropTypes.any, // mock componentWillReceiveProps
}, {
@@ -113,7 +114,8 @@ const SubPopupMenu = {
mixins: [BaseMixin],
created () {
- const props = this.$props
+ const props = getOptionProps(this)
+ this.prevProps = { ...props }
props.store.setState({
activeKey: {
...props.store.getState().activeKey,
@@ -130,12 +132,21 @@ const SubPopupMenu = {
},
updated () {
const props = getOptionProps(this)
+ const prevProps = this.prevProps
const originalActiveKey = 'activeKey' in props ? props.activeKey
: props.store.getState().activeKey[getEventKey(props)]
const activeKey = getActiveKey(props, originalActiveKey)
if (activeKey !== originalActiveKey) {
updateActiveKey(props.store, getEventKey(props), activeKey)
+ } else if ('activeKey' in prevProps) {
+ // If prev activeKey is not same as current activeKey,
+ // we should set it.
+ const prevActiveKey = getActiveKey(prevProps, prevProps.activeKey)
+ if (activeKey !== prevActiveKey) {
+ updateActiveKey(props.store, getEventKey(props), activeKey)
+ }
}
+ this.prevProps = { ...props }
},
methods: {
// all keyboard events callbacks run from here at first