fix: fix search input when value is prepopulated
parent
5ef7a2a7da
commit
978e7b68a1
|
@ -26,6 +26,13 @@ export default class Search extends React.PureComponent {
|
|||
this.handleChange = throttleIdleTask(this.handleChange.bind(this))
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
// in some cases (e.g. preact) the input may already be pre-populated
|
||||
if (this.input.value) {
|
||||
this.search(this.input.value)
|
||||
}
|
||||
}
|
||||
|
||||
search(value) {
|
||||
if (value == '')
|
||||
this.setState({
|
||||
|
|
Loading…
Reference in New Issue