diff --git a/src/components/searchbar/SearchBar.tsx b/src/components/searchbar/SearchBar.tsx index 1f64aa6..0504a96 100644 --- a/src/components/searchbar/SearchBar.tsx +++ b/src/components/searchbar/SearchBar.tsx @@ -14,6 +14,12 @@ const SearchBar = ({ placeholder, onSearch }: SearchBarProps) => { if (onSearch) onSearch(inputValue); }; + const handleKeyDown = (e: React.KeyboardEvent) => { + if (e.key === 'Enter') { + handleSearch(); + } + }; + return (
{ placeholder={placeholder} value={inputValue} onChange={(e) => setInputValue(e.target.value)} + onKeyDown={handleKeyDown} />