Skip to content

Commit

Permalink
Add Shift+Enter to go to previous search result (#17005)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo-Duke authored and Brian Vaughn committed Dec 22, 2019
1 parent 85d9655 commit 6215e1c
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 6215e1c

Please sign in to comment.