fix(SW-1115) merge to one if

This commit is contained in:
Pontus Dreij
2024-12-11 13:01:07 +01:00
parent 3c9aaa3dd3
commit df6333fa22

View File

@@ -210,10 +210,8 @@ export default function Search({ locations, handlePressEnter }: SearchProps) {
onChange: handleOnChange, onChange: handleOnChange,
}), }),
onKeyDown: (e) => { onKeyDown: (e) => {
if (e.key === "Enter") { if (e.key === "Enter" && !isOpen) {
if (!isOpen) { handlePressEnter()
handlePressEnter()
}
} }
}, },
type: "search", type: "search",