@@ -34,25 +34,6 @@ export default function SearchInput(props: Props) {
3434 [ dispatch ] ,
3535 ) ;
3636
37- const handleKeyDown = useCallback (
38- event => {
39- // For convenience, let up/down arrow keys change Tree selection.
40- switch ( event . key ) {
41- case 'ArrowDown' :
42- dispatch ( { type : 'SELECT_NEXT_ELEMENT_IN_TREE' } ) ;
43- event . preventDefault ( ) ;
44- break ;
45- case 'ArrowUp' :
46- dispatch ( { type : 'SELECT_PREVIOUS_ELEMENT_IN_TREE' } ) ;
47- event . preventDefault ( ) ;
48- break ;
49- default :
50- break ;
51- }
52- } ,
53- [ dispatch ] ,
54- ) ;
55-
5637 const handleInputKeyPress = useCallback (
5738 ( { key, shiftKey} ) => {
5839 if ( key === 'Enter' ) {
@@ -98,7 +79,6 @@ export default function SearchInput(props: Props) {
9879 < input
9980 className = { styles . Input }
10081 onChange = { handleTextChange }
101- onKeyDown = { handleKeyDown }
10282 onKeyPress = { handleInputKeyPress }
10383 placeholder = "Search (text or /regex/)"
10484 ref = { inputRef }
@@ -115,14 +95,23 @@ export default function SearchInput(props: Props) {
11595 className = { styles . IconButton }
11696 disabled = { ! searchText }
11797 onClick = { ( ) => dispatch ( { type : 'GO_TO_PREVIOUS_SEARCH_RESULT' } ) }
118- title = "Scroll to previous search result" >
98+ title = {
99+ < React . Fragment >
100+ Scroll to previous search result (< kbd > Shift</ kbd > +{ ' ' }
101+ < kbd > Enter</ kbd > )
102+ </ React . Fragment >
103+ } >
119104 < ButtonIcon type = "up" />
120105 </ Button >
121106 < Button
122107 className = { styles . IconButton }
123108 disabled = { ! searchText }
124109 onClick = { ( ) => dispatch ( { type : 'GO_TO_NEXT_SEARCH_RESULT' } ) }
125- title = "Scroll to next search result" >
110+ title = {
111+ < React . Fragment >
112+ Scroll to next search result (< kbd > Enter</ kbd > )
113+ </ React . Fragment >
114+ } >
126115 < ButtonIcon type = "down" />
127116 </ Button >
128117 < Button
0 commit comments