Skip to content

Commit

Permalink
Merge branch 'pr/1082'
Browse files Browse the repository at this point in the history
  • Loading branch information
JedWatson committed Jul 17, 2016
2 parents b1893aa + 89638ae commit 5af2adc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,14 @@ const Select = React.createClass({
// Call focus() again here to be safe.
this.focus();

// clears value so that the cursor will be a the end of input then the component re-renders
this.refs.input.value = '';
let input = this.refs.input;
if (typeof input.getInput === 'function') {
// Get the actual DOM input if the ref is an <Input /> component
input = input.getInput();
}

// clears the value so that the cursor will be at the end of input when the component re-renders
input.value = '';

// if the input is focused, ensure the menu is open
this.setState({
Expand Down

0 comments on commit 5af2adc

Please sign in to comment.