From 964482916b29378ac65012faf5c25b639bf81248 Mon Sep 17 00:00:00 2001 From: lachiet Date: Mon, 11 Dec 2017 18:29:30 +1100 Subject: [PATCH] Use onSelectResetsInput for single select Allow onSelectResetsInput to persist the inputValue on single selects. --- src/Select.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Select.js b/src/Select.js index 3769e7ec4f..b4931cd82e 100644 --- a/src/Select.js +++ b/src/Select.js @@ -560,8 +560,8 @@ class Select extends React.Component { if (this.props.closeOnSelect) { this.hasScrolledToOption = false; } + const updatedValue = this.props.onSelectResetsInput ? '' : this.state.inputValue; if (this.props.multi) { - const updatedValue = this.props.onSelectResetsInput ? '' : this.state.inputValue; this.setState({ focusedIndex: null, inputValue: this.handleInputValueChange(updatedValue), @@ -576,7 +576,7 @@ class Select extends React.Component { }); } else { this.setState({ - inputValue: this.handleInputValueChange(''), + inputValue: this.handleInputValueChange(updatedValue), isOpen: !this.props.closeOnSelect, isPseudoFocused: this.state.isFocused, }, () => {