fixed search result reset issue
This commit is contained in:
parent
cb3c82475b
commit
dab1e5334e
1 changed files with 5 additions and 0 deletions
|
@ -35,6 +35,11 @@ class Searchbar extends React.Component {
|
|||
};
|
||||
|
||||
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.throttledSearchChange(this.state.searchValue);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue