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