-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: do not allow search submit if no terms entered #446
Conversation
@@ -104,6 +104,9 @@ const SearchBar: React.FC<SearchBarProps> = ({ handleSubmit }) => { | |||
} | |||
}; | |||
const handleSearchClick = () => { | |||
if (selectedOptions?.length === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if selectedOptions
could be undefined and that would then cause this to be false and submit the form anyways, but it looks like its always set to []
as far as I can tell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, its default is always [] if the state is never changed! as long as no one ever changes any of the setSelectedOptions([])
to something other than []
, we should be in the clear! Another potential issue could be if event.target.value
is ever undefined... I don't see how that could happen unless there was some sort of data issue with the search suggestions, though.
* fix: use correct indication attribute name (#408) * fix: add URL cites back (#409) * add release information component for footer * run prettier * cleanup: make about links consistent (#413) * make footer no longer sticky * fix: correct source versioning (#421) * fix: clean up GtoP import (#419) * fix: use latest GO address (#424) * feat: bump drugbank version (#422) * feat: alphabetize sources * refactor: alphabetize sources * style: running prettier to prettify the sort data function * fix: sort on pmid and source columns * feat: add sources to interaction page * feat: reduce precision of interaction score on interaction page to 2 decimal places * fix: fix typo (#444) * fix: do not allow search submit if no terms entered (#446) --------- Co-authored-by: James Stevenson <james.stevenson@nationwidechildrens.org> Co-authored-by: Adam Coffman <acoffman@wustl.edu>
* disable strict build in github actions for now * set variable directly in build command * Automated frontend build * remove key entries if nil * auth differently when CI is set * add libraries required for ssh auth * removing stale file * Automated frontend build * Dev (#442) * fix: use correct indication attribute name (#408) * fix: add URL cites back (#409) * add release information component for footer * run prettier * cleanup: make about links consistent (#413) * make footer no longer sticky * fix: correct source versioning (#421) * fix: clean up GtoP import (#419) * fix: use latest GO address (#424) * feat: bump drugbank version (#422) * feat: alphabetize sources * refactor: alphabetize sources * style: running prettier to prettify the sort data function * fix: sort on pmid and source columns * feat: add sources to interaction page * feat: reduce precision of interaction score on interaction page to 2 decimal places --------- Co-authored-by: James Stevenson <james.stevenson@nationwidechildrens.org> Co-authored-by: Adam Coffman <acoffman@wustl.edu> * Automated frontend build * Dev (#447) * fix: use correct indication attribute name (#408) * fix: add URL cites back (#409) * add release information component for footer * run prettier * cleanup: make about links consistent (#413) * make footer no longer sticky * fix: correct source versioning (#421) * fix: clean up GtoP import (#419) * fix: use latest GO address (#424) * feat: bump drugbank version (#422) * feat: alphabetize sources * refactor: alphabetize sources * style: running prettier to prettify the sort data function * fix: sort on pmid and source columns * feat: add sources to interaction page * feat: reduce precision of interaction score on interaction page to 2 decimal places * fix: fix typo (#444) * fix: do not allow search submit if no terms entered (#446) --------- Co-authored-by: James Stevenson <james.stevenson@nationwidechildrens.org> Co-authored-by: Adam Coffman <acoffman@wustl.edu> * Automated frontend build * Automated frontend build --------- Co-authored-by: Adam Coffman <acoffman@wustl.edu> Co-authored-by: acoffman <acoffman@users.noreply.github.com> Co-authored-by: katiestahl <katiestahl@users.noreply.github.com> Co-authored-by: James Stevenson <james.stevenson@nationwidechildrens.org>
close #415