1
0
Fork 0

fix(docsearch): don't blur input on submit

This commit is contained in:
François Chalifour 2020-07-23 10:43:56 +02:00
parent dfa63df4d0
commit ecda3d3da8

View file

@ -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}
>
<label className="DocSearch-MagnifierLabel" {...props.getLabelProps()}>