Merge pull request #1518 from SundeepChand/bugfix/issue#1512

Bugfix/issue#1512
This commit is contained in:
Cassie Tarakajian 2020-07-28 11:28:31 -04:00 committed by GitHub
commit a937b767b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 10 deletions

View file

@ -23,20 +23,13 @@ class Searchbar extends React.Component {
}); });
} }
handleSearchEnter = (e) => {
if (e.key === 'Enter') {
this.searchChange();
}
}
searchChange = () => { searchChange = () => {
if (this.state.searchValue.trim().length === 0) return;
this.props.setSearchTerm(this.state.searchValue.trim()); this.props.setSearchTerm(this.state.searchValue.trim());
}; };
handleSearchChange = (e) => { handleSearchChange = (e) => {
this.setState({ searchValue: e.target.value }, () => { this.setState({ searchValue: e.target.value }, () => {
this.throttledSearchChange(this.state.searchValue); this.throttledSearchChange(this.state.searchValue.trim());
}); });
} }
@ -53,7 +46,6 @@ class Searchbar extends React.Component {
value={searchValue} value={searchValue}
placeholder={this.props.searchLabel} placeholder={this.props.searchLabel}
onChange={this.handleSearchChange} onChange={this.handleSearchChange}
onKeyUp={this.handleSearchEnter}
/> />
<button <button
className="searchbar__clear-button" className="searchbar__clear-button"

View file

@ -25,7 +25,7 @@ _Note_: The installation steps assume you are using a Unix-like shell. If you ar
* For Mac OSX with [homebrew](http://brew.sh/): `brew tap mongodb/brew` then `brew install mongodb-community` and finally start the server with `brew services start mongodb-community` or you can visit the installation guide here [Installation Guide For MacOS](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/) * For Mac OSX with [homebrew](http://brew.sh/): `brew tap mongodb/brew` then `brew install mongodb-community` and finally start the server with `brew services start mongodb-community` or you can visit the installation guide here [Installation Guide For MacOS](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/)
* For Windows and Linux: [MongoDB Installation](https://docs.mongodb.com/manual/installation/) * For Windows and Linux: [MongoDB Installation](https://docs.mongodb.com/manual/installation/)
7. `$ cp .env.example .env` 7. `$ cp .env.example .env`
8. (Optional) Update `.env` with necessary keys to enable certain app behavoirs, i.e. add Github ID and Github Secret if you want to be able to log in with Github. 8. (Optional) Update `.env` with necessary keys to enable certain app behaviors, i.e. add Github ID and Github Secret if you want to be able to log in with Github.
9. `$ npm run fetch-examples` - this downloads the example sketches into a user called 'p5' 9. `$ npm run fetch-examples` - this downloads the example sketches into a user called 'p5'
10. `$ npm start` 10. `$ npm start`
11. Navigate to [http://localhost:8000](http://localhost:8000) in your browser 11. Navigate to [http://localhost:8000](http://localhost:8000) in your browser