Merge pull request #5884 from jeffalo/dont-search-empty-strings

Prevent searches for empty strings
This commit is contained in:
Sarah Otts 2021-10-18 16:16:15 -04:00 committed by GitHub
commit e0a5ae5c68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)}`;