Fixed pressing space or clicking dd input closes dd

pull/21833/head
Luke Barnard 2017-05-18 16:58:57 +01:00
parent 90ee0c7ad9
commit f99fa3ac1a
1 changed files with 6 additions and 4 deletions

View File

@ -152,10 +152,12 @@ export default class Dropdown extends React.Component {
}
_onInputClick(ev) {
this.setState({
expanded: !this.state.expanded,
});
ev.preventDefault();
if (!this.state.expanded) {
this.setState({
expanded: !this.state.expanded,
});
ev.preventDefault();
}
}
_onMenuOptionClick(dropdownKey) {