Skip to content

Commit

Permalink
Fix: Escape ut av søkefelt navigerer til forrige side (#1174)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornreppen authored Mar 22, 2019
1 parent 5712d55 commit 35d163d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/SearchBox/SearchBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,18 @@ class SearchBox extends Component {
target: { value: this.props.searchFor.split("/").join(" ") }
});
}
// if (this.props.query && !prevprops.query) this.inputRef.current.select();
}

handleKeyDown = e => {
switch (e.keyCode) {
handleKeyDown = event => {
switch (event.keyCode) {
case 13:
this.props.onKeyEnter();
this.inputRef.current.blur();
break;
case 27:
this.props.onBlur(false);
/* this.props.onQueryChange({
target: { value: "" }
});*/
this.inputRef.current.blur();
event.stopPropagation();
break;
default:
break;
Expand Down

0 comments on commit 35d163d

Please sign in to comment.