@@ -34,25 +34,6 @@ export default function SearchInput(props: Props) {
34
34
[ dispatch ] ,
35
35
) ;
36
36
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
-
56
37
const handleInputKeyPress = useCallback (
57
38
( { key, shiftKey} ) => {
58
39
if ( key === 'Enter' ) {
@@ -98,7 +79,6 @@ export default function SearchInput(props: Props) {
98
79
< input
99
80
className = { styles . Input }
100
81
onChange = { handleTextChange }
101
- onKeyDown = { handleKeyDown }
102
82
onKeyPress = { handleInputKeyPress }
103
83
placeholder = "Search (text or /regex/)"
104
84
ref = { inputRef }
@@ -115,14 +95,23 @@ export default function SearchInput(props: Props) {
115
95
className = { styles . IconButton }
116
96
disabled = { ! searchText }
117
97
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
+ } >
119
104
< ButtonIcon type = "up" />
120
105
</ Button >
121
106
< Button
122
107
className = { styles . IconButton }
123
108
disabled = { ! searchText }
124
109
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
+ } >
126
115
< ButtonIcon type = "down" />
127
116
</ Button >
128
117
< Button
0 commit comments