Merge pull request #909 from jussch/patch-3

Moves the Autocomplete enter check to onKeyDown to resolve form submit bug
old
Javi Velasco 2016-11-01 14:39:12 +01:00 committed by GitHub
commit fb72442eba
1 changed files with 3 additions and 3 deletions

View File

@ -116,9 +116,7 @@ const factory = (Chip, Input) => {
if (shouldClearQuery) {
this.setState({query: ''});
}
};
handleQueryKeyUp = (event) => {
if (event.which === 13) {
let target = this.state.active;
if (!target) {
@ -129,7 +127,9 @@ const factory = (Chip, Input) => {
}
this.select(event, target);
}
};
handleQueryKeyUp = (event) => {
if (event.which === 27) ReactDOM.findDOMNode(this).querySelector('input').blur();
if ([40, 38].indexOf(event.which) !== -1) {