Skip to content

Commit 4eae003

Browse files
committed
feat: enable form submission on Enter key press in search page
1 parent 966aab2 commit 4eae003

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pages/SearchPage.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,9 @@ const SearchPage: React.FC = () => {
268268
>
269269
<Button
270270
variant="contained"
271-
onClick={() => document.querySelector("form")?.requestSubmit()}
271+
// onClick={() => document.querySelector("form")?.requestSubmit()}
272+
type="submit"
273+
form="search-form"
272274
sx={{
273275
backgroundColor: Colors.purple,
274276
color: Colors.white,
@@ -296,6 +298,7 @@ const SearchPage: React.FC = () => {
296298
</Button>
297299
</Box>
298300
<Form
301+
id="search-form"
299302
schema={schema}
300303
onSubmit={handleSubmit}
301304
validator={validator}

0 commit comments

Comments
 (0)