@alexkuz/react-autocomplete
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -165,2 +165,8 @@ 'use strict'; | ||
} | ||
if (this.props.value === this.state.inputValue) { | ||
var inputValue = this.findInputValue(); | ||
if (inputValue !== this.state.inputValue) { | ||
this.setState({ inputValue: inputValue }); | ||
} | ||
} | ||
}, | ||
@@ -229,7 +235,9 @@ | ||
handleInputChange: function handleInputChange(event) { | ||
var value = ReactDom.findDOMNode(this.refs.input).value; | ||
this.clearSelectedState((function () { | ||
this.props.onInput(value); | ||
if (!this.state.isOpen) this.showList(); | ||
}).bind(this)); | ||
this.setState({ | ||
inputValue: event.target.value, | ||
focusedIndex: null, | ||
matchedAutocompleteOption: null | ||
}); | ||
this.props.onInput && this.props.onInput(event.target.value); | ||
if (!this.state.isOpen) this.showList(); | ||
}, | ||
@@ -294,4 +302,6 @@ | ||
if (!fragment) return; | ||
input.value = label; | ||
input.setSelectionRange(inputValue.length, label.length); | ||
setTimeout(function () { | ||
input.value = label; | ||
input.setSelectionRange(inputValue.length, label.length); | ||
}, 10); | ||
this.setState({ matchedAutocompleteOption: firstChild }); | ||
@@ -298,0 +308,0 @@ }, |
{ | ||
"name": "@alexkuz/react-autocomplete", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23018
551