Skip to content

Commit

Permalink
fix(Dropdown): Menu event in Dropdown fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Apr 9, 2018
1 parent df8209e commit 2176361
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/md/cn/dropdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ class Demo extends Component {
<Dropdown trigger="click" menu={menu}>
<Button>下拉菜单</Button>
</Dropdown>
<Divider />
<Dropdown trigger="hover" menu={menu}>
<Button>下拉菜单</Button>
</Dropdown>
</div>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ export default class Dropdown extends Component {
}
onSelectMenu = (index, menuItem) => {
const { menu, onVisibleChange } = this.props;
if (this.showDropdown && menu) {
if (menu && menu.props) {
this.setState({ visible: false }, () => {
this.showDropdown = false;
menu && menu.props && menu.props.onSelect && menu.props.onSelect(index, menuItem, menu);
menu.props.onSelect && menu.props.onSelect(index, menuItem, menu);
onVisibleChange(this.state.visible);
});
}
Expand Down

0 comments on commit 2176361

Please sign in to comment.