Skip to content

Commit e9e4ba7

Browse files
committed
fix: defaultActiveFirstOption is true and activeKey is undefined vueComponent#1727
1 parent 9d31b6f commit e9e4ba7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/vc-menu/SubPopupMenu.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ export function getActiveKey(props, originalActiveKey) {
6565
if (defaultActiveFirst) {
6666
loopMenuItem(children, (c, i) => {
6767
const propsData = c.componentOptions.propsData || {};
68-
if (activeKey === null && c && !propsData.disabled) {
68+
const noActiveKey = activeKey === null || activeKey === undefined;
69+
if (noActiveKey && c && !propsData.disabled) {
6970
activeKey = getKeyFromChildrenIndex(c, eventKey, i);
7071
}
7172
});

0 commit comments

Comments
 (0)