Skip to content

Commit

Permalink
Merge pull request #99 from aodn/bugfix/5761-refactor-code-InputWithS…
Browse files Browse the repository at this point in the history
…uggester

🎨 refactor code in InputWithSuggester
  • Loading branch information
HavierD authored Jul 23, 2024
2 parents 2b30bdb + 3c3a0ab commit d5d389e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/search/InputWithSuggester.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,10 @@ const InputWithSuggester: FC<InputWithSuggesterProps> = ({
const handleKeyDown = (
event: React.KeyboardEvent<HTMLTextAreaElement | HTMLInputElement>
) => {
if (event.key === "Enter" && open === true) {
setOpen(false);
handleEnterPressed(event, false);
}
if (event.key === "Enter" && open === false) {
if (event.key === "Enter") {
if (open) {
setOpen(false);
}
handleEnterPressed(event, false);
}
};
Expand Down

0 comments on commit d5d389e

Please sign in to comment.