fixed search result reset issue

This commit is contained in:
Sundeep Chand 2020-07-27 23:47:51 +05:30
parent d37c552144
commit e299bf2a39
1 changed files with 5 additions and 0 deletions

View File

@ -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);
});