From ecda3d3da8796bf56925458aecc2925c7681468a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Thu, 23 Jul 2020 10:43:56 +0200 Subject: [PATCH] fix(docsearch): don't blur input on submit --- src/SearchBox.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SearchBox.tsx b/src/SearchBox.tsx index 44920f1e..ecdffc1d 100644 --- a/src/SearchBox.tsx +++ b/src/SearchBox.tsx @@ -24,7 +24,7 @@ interface SearchBoxProps } export function SearchBox(props: SearchBoxProps) { - const { onSubmit, onReset } = props.getFormProps({ + const { onReset } = props.getFormProps({ inputElement: props.inputRef.current, }); @@ -41,7 +41,9 @@ export function SearchBox(props: SearchBoxProps) { role="search" noValidate className="DocSearch-Form" - onSubmit={onSubmit} + onSubmit={(event) => { + event.preventDefault(); + }} onReset={onReset} >