Skip to content

Commit

Permalink
fix(autocomplete): set carriage position to end of new value on option (
Browse files Browse the repository at this point in the history
  • Loading branch information
iyromanov authored and tx44 committed Oct 4, 2017
1 parent 1cb4f6e commit 2670a11
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/input-autocomplete/input-autocomplete.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ class InputAutocomplete extends React.Component {
if (this.props.closeOnSelect) {
this.inputBlurTimeout = setTimeout(() => this.input.blur(), 0);
} else {
this.inputFocusTimeout = setTimeout(() => this.input.focus(), 0);
this.inputFocusTimeout = setTimeout(() => {
this.input.focus();
this.input.setSelectionRange(newValue.length);
}, 0);
}
}

Expand Down

0 comments on commit 2670a11

Please sign in to comment.