@samitouri / QOS-React-2 / commits / 6215e1c2db

Add Shift+Enter to go to previous search result (#17005)

Maxime Bouveron committed Dec 22, 2019 at 17:38 UTC 6215e1c2db7e55a364a1156be38b4e3d7490d551
1 file changed +6 -2
packages/react-devtools-shared/src/devtools/views/Components/SearchInput.js
+6 -2
@@ -53,9 +53,13 @@ export default function SearchInput(props: Props) {
53 );
54
55 const handleInputKeyPress = useCallback(
56 - ({key}) => {
56 + ({key, shiftKey}) => {
57 if (key === 'Enter') {
58 - dispatch({type: 'GO_TO_NEXT_SEARCH_RESULT'});
58 + if (shiftKey) {
59 + dispatch({type: 'GO_TO_PREVIOUS_SEARCH_RESULT'});
60 + } else {
61 + dispatch({type: 'GO_TO_NEXT_SEARCH_RESULT'});
62 + }
63 }
64 },
65 [dispatch],