diff --git a/client/modules/IDE/components/Searchbar/Searchbar.jsx b/client/modules/IDE/components/Searchbar/Searchbar.jsx index cd9693bd..3b9c92c0 100644 --- a/client/modules/IDE/components/Searchbar/Searchbar.jsx +++ b/client/modules/IDE/components/Searchbar/Searchbar.jsx @@ -23,25 +23,19 @@ class Searchbar extends React.Component { }); } - handleSearchEnter = (e) => { - if (e.key === 'Enter') { - this.searchChange(); - } - } + // handleSearchEnter = (e) => { + // if (e.key === 'Enter') { + // this.searchChange(); + // } + // } searchChange = () => { - if (this.state.searchValue.trim().length === 0) return; this.props.setSearchTerm(this.state.searchValue.trim()); }; 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); + this.throttledSearchChange(this.state.searchValue.trim()); }); } @@ -58,7 +52,7 @@ class Searchbar extends React.Component { value={searchValue} placeholder={this.props.searchLabel} onChange={this.handleSearchChange} - onKeyUp={this.handleSearchEnter} + // onKeyUp={this.handleSearchEnter} />