[#1512] Update searchbar to query with empty term
This commit is contained in:
parent
dab1e5334e
commit
9470fd12ff
1 changed files with 1 additions and 7 deletions
|
@ -30,18 +30,12 @@ class Searchbar extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
searchChange = () => {
|
searchChange = () => {
|
||||||
if (this.state.searchValue.trim().length === 0) return;
|
|
||||||
this.props.setSearchTerm(this.state.searchValue.trim());
|
this.props.setSearchTerm(this.state.searchValue.trim());
|
||||||
};
|
};
|
||||||
|
|
||||||
handleSearchChange = (e) => {
|
handleSearchChange = (e) => {
|
||||||
if (e.target.value === '') {
|
|
||||||
// Manually reset the searchValue if the search field becomes empty.
|
|
||||||
this.handleResetSearch();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.setState({ searchValue: e.target.value }, () => {
|
this.setState({ searchValue: e.target.value }, () => {
|
||||||
this.throttledSearchChange(this.state.searchValue);
|
this.throttledSearchChange(this.state.searchValue.trim());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue