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