fix: defaultActiveFirstOption is true and activeKey is Falsy will ret… (#1979)
* fix: defaultActiveFirstOption is true and activeKey is Falsy will return the next child key #1727 * fix: defaultActiveFirstOption is true and activeKey is undefined #1727pull/2037/head
parent
082dc2ade0
commit
94b701c077
|
@ -65,7 +65,8 @@ export function getActiveKey(props, originalActiveKey) {
|
||||||
if (defaultActiveFirst) {
|
if (defaultActiveFirst) {
|
||||||
loopMenuItem(children, (c, i) => {
|
loopMenuItem(children, (c, i) => {
|
||||||
const propsData = c.componentOptions.propsData || {};
|
const propsData = c.componentOptions.propsData || {};
|
||||||
if (!activeKey && c && !propsData.disabled) {
|
const noActiveKey = activeKey === null || activeKey === undefined;
|
||||||
|
if (noActiveKey && c && !propsData.disabled) {
|
||||||
activeKey = getKeyFromChildrenIndex(c, eventKey, i);
|
activeKey = getKeyFromChildrenIndex(c, eventKey, i);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue