Skip to content

Commit 3ee7d86

Browse files
author
Ryan Zec
committed
fixed issue with chrome showing some extra spacing below the input in certain circumstances
1 parent c67f0b2 commit 3ee7d86

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/Select.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,20 +513,23 @@ const Select = React.createClass({
513513
},
514514

515515
selectValue (value) {
516+
//NOTE: update value in the callback to make sure the input value is empty so that there are no sttyling issues (Chrome had issue otherwise)
516517
this.hasScrolledToOption = false;
517518
if (this.props.multi) {
518-
this.addValue(value);
519519
this.setState({
520520
inputValue: '',
521521
focusedIndex: null
522+
}, () => {
523+
this.addValue(value);
522524
});
523525
} else {
524526
this.setState({
525527
isOpen: false,
526528
inputValue: '',
527529
isPseudoFocused: this.state.isFocused,
530+
}, () => {
531+
this.setValue(value);
528532
});
529-
this.setValue(value);
530533
}
531534
},
532535

0 commit comments

Comments
 (0)