We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65e8759 commit 4c9d939Copy full SHA for 4c9d939
components/Search.tsx
@@ -19,7 +19,10 @@ export default function Search({ searchBarWrapperStyles }: SearchProps) {
19
});
20
21
const onSubmit: SubmitHandler<FormValues> = ({ searchQuery }) => {
22
- router.push({ query: { ...router.query, q: searchQuery } });
+ let trimmedQuery = searchQuery.trim();
23
+ if(trimmedQuery !== ''){ //Performs search only with non-empty strings
24
+ router.push({ query: { ...router.query, q: trimmedQuery } });
25
+ }
26
};
27
28
return (
0 commit comments