File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
lib/components/form/element Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -220,9 +220,10 @@ class Combobox extends React.Component {
220220 if ( optionsChanged || alreadySelectedChanged ) {
221221 // If only alreadySelectedOptions changed and dropdown is open, just update options without resetting
222222 if ( ! optionsChanged && alreadySelectedChanged && this . state . isDropdownOpen ) {
223- this . setState ( {
224- options : this . getTruncatedOptions ( this . state . currentValue , nextProps . alreadySelectedOptions ) ,
225- } ) ;
223+ const { currentValue} = this . state ;
224+ this . setState ( ( ) => ( {
225+ options : this . getTruncatedOptions ( currentValue , nextProps . alreadySelectedOptions ) ,
226+ } ) ) ;
226227 } else {
227228 // Options changed or dropdown is closed - do full reset
228229 this . reset ( false , nextProps . options , nextProps . alreadySelectedOptions ) ;
You can’t perform that action at this time.
0 commit comments