Commit f011b6c 1 parent ed3ef43 commit f011b6c Copy full SHA for f011b6c
File tree 1 file changed +14
-0
lines changed
src/component-library/features/search
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,18 @@ export const DIDSearchPanel = (props: SearchPanelProps) => {
96
96
props . stopStreaming ( ) ;
97
97
} ;
98
98
99
+ const onScopeArrowDown = ( event : React . KeyboardEvent < HTMLInputElement > ) => {
100
+ if ( event . key === 'ArrowRight' ) {
101
+ nameInputRef . current ?. focus ( ) ;
102
+ }
103
+ } ;
104
+
105
+ const onNameArrowDown = ( event : React . KeyboardEvent < HTMLInputElement > ) => {
106
+ if ( event . key === 'ArrowLeft' ) {
107
+ scopeInputRef . current ?. focus ( ) ;
108
+ }
109
+ } ;
110
+
99
111
return (
100
112
< div className = "flex flex-col space-y-2 w-full md:items-start md:flex-row md:space-y-0 md:space-x-2" >
101
113
< div className = "flex flex-col grow sm:flex-row space-y-2 sm:space-x-2 sm:space-y-0" >
@@ -121,6 +133,7 @@ export const DIDSearchPanel = (props: SearchPanelProps) => {
121
133
setScope ( event . target . value ) ;
122
134
} }
123
135
onEnterKey = { onSearch }
136
+ onKeyDown = { onScopeArrowDown }
124
137
/>
125
138
< span className = "text-neutral-900 dark:text-neutral-100 font-bold" > :</ span >
126
139
< Input
@@ -131,6 +144,7 @@ export const DIDSearchPanel = (props: SearchPanelProps) => {
131
144
setName ( event . target . value ) ;
132
145
} }
133
146
onEnterKey = { onSearch }
147
+ onKeyDown = { onNameArrowDown }
134
148
/>
135
149
</ div >
136
150
</ div >
You can’t perform that action at this time.
0 commit comments