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:
parent
49226edd07
commit
6c86121120
1 changed files with 2 additions and 2 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue