@@ -484,12 +484,12 @@ export default class Select extends Component<Props, State> {
484
484
485
485
openMenu ( focusOption : 'first' | 'last' ) {
486
486
const { menuOptions , selectValue , isFocused } = this . state ;
487
- const { isMulti } = this . props ;
487
+ const { isMulti , options } = this . props ;
488
488
let openAtIndex =
489
489
focusOption === 'first' ? 0 : menuOptions . focusable . length - 1 ;
490
490
491
491
if ( ! isMulti ) {
492
- const selectedIndex = menuOptions . focusable . indexOf ( selectValue [ 0 ] ) ;
492
+ const selectedIndex = options . indexOf ( selectValue [ 0 ] ) ;
493
493
if ( selectedIndex > - 1 ) {
494
494
openAtIndex = selectedIndex ;
495
495
}
@@ -502,7 +502,7 @@ export default class Select extends Component<Props, State> {
502
502
this . onMenuOpen ( ) ;
503
503
this . setState ( {
504
504
focusedValue : null ,
505
- focusedOption : menuOptions . focusable [ openAtIndex ] ,
505
+ focusedOption : options [ openAtIndex ] ,
506
506
} ) ;
507
507
508
508
this . announceAriaLiveContext ( { event : 'menu' } ) ;
@@ -773,9 +773,9 @@ export default class Select extends Component<Props, State> {
773
773
}
774
774
775
775
getNextFocusedOption ( options : OptionsType ) {
776
- const { focusedOption : lastFocusedOption } = this . state ;
777
- return lastFocusedOption && options . indexOf ( lastFocusedOption ) > - 1
778
- ? lastFocusedOption
776
+ const { selectValue : lastFocusedOption } = this . state ;
777
+ return lastFocusedOption && options . indexOf ( lastFocusedOption [ 0 ] ) > - 1
778
+ ? lastFocusedOption [ 0 ]
779
779
: options [ 0 ] ;
780
780
}
781
781
getOptionLabel = ( data : OptionType ) : string => {
0 commit comments