forgot to run onSubmit callback on enter lol
This commit is contained in:
parent
bd0fc36ea5
commit
866859f74e
1 changed files with 1 additions and 0 deletions
|
@ -20,6 +20,7 @@ export default function SearchBar({
|
||||||
const handleKeyPress = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
const handleKeyPress = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||||
if (e.key === 'Enter') {
|
if (e.key === 'Enter') {
|
||||||
router.push(`/search?q=${encodeURIComponent(searchInput)}`)
|
router.push(`/search?q=${encodeURIComponent(searchInput)}`)
|
||||||
|
onSubmit && onSubmit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue