File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,12 @@ export const Search = ({ descriptors }: SearchParams) => {
98
98
99
99
function keyPressHandler ( event : React . KeyboardEvent , index : number ) {
100
100
if ( event . key === "ArrowDown" && index + 1 < ( results ?. length ?? 0 ) ) {
101
- document . getElementById ( `SearchResultItem_Link_${ index + 1 } ` ) ?. focus ( ) ;
101
+ document . getElementById ( `SearchResultItem_Link_${ index + 1 } ` ) ?. focus ( ) ;
102
102
event . preventDefault ( ) ;
103
103
} else if ( event . key === "ArrowUp" && index >= 0 ) {
104
- const target = document . getElementById ( index === 0 ? "Search_Input" : `SearchResultItem_Link_${ index - 1 } ` ) ;
104
+ const target = document . getElementById (
105
+ index === 0 ? "Search_Input" : `SearchResultItem_Link_${ index - 1 } ` ,
106
+ ) ;
105
107
target ?. focus ( ) ;
106
108
event . preventDefault ( ) ;
107
109
}
@@ -128,7 +130,7 @@ export const Search = ({ descriptors }: SearchParams) => {
128
130
to = { `${ result . obj . url } ` }
129
131
onClick = { ( ) => setSearchTerm ( "" ) }
130
132
onKeyDown = { ( event ) => keyPressHandler ( event , ind ) }
131
- >
133
+ >
132
134
< Match result = { result } />
133
135
</ ItemLink >
134
136
</ SearchResultItem >
You can’t perform that action at this time.
0 commit comments