@@ -369,7 +369,7 @@ export default class Select extends Component<Props, State> {
369
369
'react-select-' + ( this . props . instanceId || ++ instanceId ) ;
370
370
371
371
const selectValue = cleanValue ( value ) ;
372
- const menuOptions = this . buildMenuOptions ( props , selectValue ) ;
372
+ const menuOptions = props . menuIsOpen ? this . buildMenuOptions ( props , selectValue ) : { render : [ ] , focusable : [ ] } ;
373
373
374
374
this . state . menuOptions = menuOptions ;
375
375
this . state . selectValue = selectValue ;
@@ -388,17 +388,18 @@ export default class Select extends Component<Props, State> {
388
388
}
389
389
}
390
390
componentWillReceiveProps ( nextProps : Props ) {
391
- const { options, value, inputValue } = this . props ;
391
+ const { options, value, menuIsOpen , inputValue } = this . props ;
392
392
// re-cache custom components
393
393
this . cacheComponents ( nextProps . components ) ;
394
394
// rebuild the menu options
395
395
if (
396
396
nextProps . value !== value ||
397
397
nextProps . options !== options ||
398
+ nextProps . menuIsOpen !== menuIsOpen ||
398
399
nextProps . inputValue !== inputValue
399
400
) {
400
401
const selectValue = cleanValue ( nextProps . value ) ;
401
- const menuOptions = this . buildMenuOptions ( nextProps , selectValue ) ;
402
+ const menuOptions = nextProps . menuIsOpen ? this . buildMenuOptions ( nextProps , selectValue ) : { render : [ ] , focusable : [ ] } ;
402
403
const focusedValue = this . getNextFocusedValue ( selectValue ) ;
403
404
const focusedOption = this . getNextFocusedOption ( menuOptions . focusable ) ;
404
405
this . setState ( { menuOptions, selectValue, focusedOption, focusedValue } ) ;
0 commit comments