backspace also triggers menu

This commit is contained in:
Cássio Zen 2016-07-07 17:14:09 -03:00
parent 64ab7937e9
commit 003867d773

View File

@ -158,9 +158,6 @@ class FindBar extends Component {
handleKeyDown(event) {
let highlightedIndex, index;
switch (event.key) {
case 'Backspace':
this.maybeRemoveActiveScope();
break;
case 'ArrowDown':
event.preventDefault();
highlightedIndex = this.state.highlightedIndex;
@ -210,6 +207,12 @@ class FindBar extends Component {
isOpen: false
}, this.maybeRemoveActiveScope);
break;
case 'Backspace':
this.setState({
highlightedIndex: 0,
isOpen: true
}, this.maybeRemoveActiveScope);
break;
default:
this.setState({
highlightedIndex: 0,