Skip to content

Commit

Permalink
fix: do not allow search submit if no terms entered
Browse files Browse the repository at this point in the history
  • Loading branch information
katiestahl committed Oct 19, 2023
1 parent aff2cf9 commit f924139
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/src/components/Shared/SearchBar/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ const SearchBar: React.FC<SearchBarProps> = ({ handleSubmit }) => {
}
};
const handleSearchClick = () => {
if (selectedOptions?.length === 0) {
return;
}
state.searchTerms = selectedOptions.map((option) => option.suggestion);
handleSubmit();
};
Expand Down

0 comments on commit f924139

Please sign in to comment.