Skip to content

Commit

Permalink
Add Shift+Enter to go to previous search result
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo-Duke committed Oct 3, 2019
1 parent 5943b1d commit 7f97d19
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ export default function SearchInput(props: Props) {
);

const handleInputKeyPress = useCallback(
({key}) => {
({key, shiftKey}) => {
if (key === 'Enter') {
dispatch({type: 'GO_TO_NEXT_SEARCH_RESULT'});
if (shiftKey) {
dispatch({type: 'GO_TO_PREVIOUS_SEARCH_RESULT'});
} else {
dispatch({type: 'GO_TO_NEXT_SEARCH_RESULT'});
}
}
},
[dispatch],
Expand Down

0 comments on commit 7f97d19

Please sign in to comment.