mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 09:35:56 -05:00
Merge pull request #5884 from jeffalo/dont-search-empty-strings
Prevent searches for empty strings
This commit is contained in:
commit
e0a5ae5c68
1 changed files with 2 additions and 0 deletions
|
@ -84,6 +84,8 @@ class Navigation extends React.Component {
|
|||
}
|
||||
|
||||
handleSearchSubmit (formData) {
|
||||
if (formData.q.trim() === '') return; // don't submit empty searches
|
||||
|
||||
let targetUrl = '/search/projects';
|
||||
if (formData.q) {
|
||||
targetUrl += `?q=${encodeURIComponent(formData.q)}`;
|
||||
|
|
Loading…
Reference in a new issue