Use onChange instead of onInput for Search component

React uses onChange for form elements (and complains if it's absent)
even when the underlying event is oninput.
This commit is contained in:
Dan Stillman 2019-03-21 04:51:32 -04:00
parent 49226edd07
commit 6c86121120

View file

@ -23,7 +23,7 @@ class Search extends React.PureComponent {
};
}
handleInput = (event) => {
handleChange = (event) => {
var value = event.target.value;
// Update controlled value and cancel button immediately
this.setState({
@ -62,7 +62,7 @@ class Search extends React.PureComponent {
<div className="search">
<input
type="search"
onInput={this.handleInput}
onChange={this.handleChange}
onKeyDown={this.handleKeyDown}
ref={this.inputRef}
value={this.state.immediateValue}