Skip to content

fix: defaultActiveFirstOption is true and activeKey is Falsy will ret… #1979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/vc-menu/SubPopupMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function getActiveKey(props, originalActiveKey) {
if (defaultActiveFirst) {
loopMenuItem(children, (c, i) => {
const propsData = c.componentOptions.propsData || {};
if (!activeKey && c && !propsData.disabled) {
if (activeKey === null && c && !propsData.disabled) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined 也要处理

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有点想当然了.. 重新提交了, 再看下哈

activeKey = getKeyFromChildrenIndex(c, eventKey, i);
}
});
Expand Down