forgot to run onSubmit callback on enter lol

This commit is contained in:
Youwen Wu 2024-02-12 23:41:25 -08:00
parent bd0fc36ea5
commit 866859f74e

View file

@ -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()
} }
} }