Skip to content

Commit

Permalink
Merge branch 'search-form' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmz committed Oct 31, 2024
2 parents f48434e + 83d20d4 commit 9ea9a79
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/components/advanced-search-form/advanced-search-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,19 @@ export function AdvancedSearchForm() {
browserHistory.push(`/search?q=${encodeURIComponent(resultingQuery)}`),
);

const onKeyDown = useEvent((e) => {
if (
e.code === 'Enter' &&
e.target.matches('input[type="text"], input[type="date"], input[type="search"]')
) {
e.preventDefault();
onSearch();
}
});

return (
<filtersContext.Provider value={ctxValue}>
<div className={style.form}>
<div className={style.form} onKeyDown={onKeyDown}>
<Section title="What to search">
<div className={style.searchInputBox}>
<input
Expand Down

0 comments on commit 9ea9a79

Please sign in to comment.