Skip to content

Commit

Permalink
added fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arinkulshi-skylight committed Feb 18, 2025
1 parent fd805a6 commit f7ac0aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions frontend/src/app/testQueue/addToQueue/AddToQueueSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ const AddToQueueSearchBox = ({
disabled={!allowQuery}
placeholder={`Search for a ${PATIENT_TERM} to start their test`}
showSubmitButton={false}
disableEnterSubmit={true}
/>
<SearchResults
page="queue"
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/app/testQueue/addToQueue/SearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type Props = {
showSubmitButton?: boolean;
labeledBy?: string;
dataCy?: string;
disableEnterSubmit?: boolean;
};

const SearchInput = ({
Expand All @@ -34,6 +35,7 @@ const SearchInput = ({
showSubmitButton = true,
labeledBy,
dataCy,
disableEnterSubmit = false,
}: Props) => {
const classes = classnames(
"usa-search",
Expand All @@ -49,9 +51,14 @@ const SearchInput = ({
}
}, [focusOnMount]);

const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
if (disableEnterSubmit) {
e.preventDefault();
}
};
return (
<div className={classnames("prime-search-container", className)}>
<form className={classes} role="search">
<form className={classes} role="search" onSubmit={handleSubmit}>
<label
className={label ? "display-block" : "usa-sr-only"}
htmlFor="search-field-small"
Expand Down

0 comments on commit f7ac0aa

Please sign in to comment.