File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
client/src/components/input Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ const SelectInput: FC<SelectInputProps> = (props) => {
1818
1919 const ref = useOuterClick ( ( ) => setIsActive ( false ) ) ;
2020 const inputRef = useRef < HTMLInputElement > ( null ) ;
21+ const activeRef = useRef < HTMLSpanElement > ( null ) ;
2122
2223 useEffect ( ( ) => {
2324 if ( filterValue . trim ( ) === "" ) {
@@ -50,7 +51,13 @@ const SelectInput: FC<SelectInputProps> = (props) => {
5051 < div
5152 onClick = { ( ) => {
5253 setIsActive ( ( prev ) => {
53- if ( ! prev ) inputRef . current ?. focus ( ) ;
54+ if ( ! prev ) {
55+ inputRef . current ?. focus ( ) ;
56+ activeRef . current ?. scrollIntoView ( {
57+ block : "nearest" ,
58+ inline : "start" ,
59+ } ) ;
60+ }
5461 return ! prev ;
5562 } ) ;
5663 } }
@@ -118,7 +125,7 @@ const SelectInput: FC<SelectInputProps> = (props) => {
118125 } `}
119126 >
120127 { isSelected && (
121- < span >
128+ < span ref = { activeRef } >
122129 < FiCheck />
123130 </ span >
124131 ) }
You can’t perform that action at this time.
0 commit comments