File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
packages/react-select/src Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -668,10 +668,16 @@ export default class Select<
668
668
focusedOptionRef : HTMLDivElement | null = null ;
669
669
getFocusedOptionRef : RefCallback < HTMLDivElement > = ( ref ) => {
670
670
this . focusedOptionRef = ref ;
671
+ if ( this . menuListRef && this . focusedOptionRef ) {
672
+ scrollIntoView ( this . menuListRef , this . focusedOptionRef ) ;
673
+ }
671
674
} ;
672
675
menuListRef : HTMLDivElement | null = null ;
673
676
getMenuListRef : RefCallback < HTMLDivElement > = ( ref ) => {
674
677
this . menuListRef = ref ;
678
+ if ( this . menuListRef && this . focusedOptionRef ) {
679
+ scrollIntoView ( this . menuListRef , this . focusedOptionRef ) ;
680
+ }
675
681
} ;
676
682
inputRef : HTMLInputElement | null = null ;
677
683
getInputRef : RefCallback < HTMLInputElement > = ( ref ) => {
You can’t perform that action at this time.
0 commit comments