ElemeFE / ElemeFE/element-react

OnSelect in Menu will repeat twice if we click Menu.Item

Open
#716 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.8k
Forks
435
PR merge metrics
No merged PRs in 30d

Description

### Description
if (props.defaultActive != this.props.defaultActive || props.defaultActive != this.state.activeIndex) {
this.defaultActiveChanged(props.defaultActive);
}
(source in componentWillReceiveProps)

The second conditions are clearly passed, but we needn't change the defaultActive. And then ,OnSelect in Menu will repeatly twice if we click Menu.Item. it takes some propblem , for example, when we click a item , the state clicking will miss and it will back the defaultActive-Index item

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.