Skip to content

Commit 9ea9a79

Browse files
committed
Merge branch 'search-form' into beta
2 parents f48434e + 83d20d4 commit 9ea9a79

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/components/advanced-search-form/advanced-search-form.jsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,19 @@ export function AdvancedSearchForm() {
7878
browserHistory.push(`/search?q=${encodeURIComponent(resultingQuery)}`),
7979
);
8080

81+
const onKeyDown = useEvent((e) => {
82+
if (
83+
e.code === 'Enter' &&
84+
e.target.matches('input[type="text"], input[type="date"], input[type="search"]')
85+
) {
86+
e.preventDefault();
87+
onSearch();
88+
}
89+
});
90+
8191
return (
8292
<filtersContext.Provider value={ctxValue}>
83-
<div className={style.form}>
93+
<div className={style.form} onKeyDown={onKeyDown}>
8494
<Section title="What to search">
8595
<div className={style.searchInputBox}>
8696
<input

0 commit comments

Comments
 (0)