fix(trim query before search)
This commit is contained in:
parent
5a79a84833
commit
ebe53c83f9
1 changed files with 4 additions and 3 deletions
|
@ -26,12 +26,13 @@ class Searchbar extends React.Component {
|
|||
|
||||
handleSearchEnter = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.props.setSearchTerm(this.state.searchValue);
|
||||
this.searchChange();
|
||||
}
|
||||
}
|
||||
|
||||
searchChange = (value) => {
|
||||
this.props.setSearchTerm(this.state.searchValue);
|
||||
searchChange = () => {
|
||||
if (this.state.searchValue.trim().length === 0) return;
|
||||
this.props.setSearchTerm(this.state.searchValue.trim());
|
||||
};
|
||||
|
||||
handleSearchChange = (e) => {
|
||||
|
|
Loading…
Reference in a new issue