File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ const Posts = () => {
77
77
78
78
const handleSearch = ( ) => {
79
79
fetchPosts ( page , 12 , searchQuery , filterTags ) ;
80
+ // console.log(searchQuery)
80
81
} ;
81
82
82
83
if ( loading ) {
@@ -165,7 +166,12 @@ const Posts = () => {
165
166
onChange = { ( e ) => setSearchQuery ( e . target . value ) }
166
167
placeholder = "🔍 Search anything"
167
168
className = "p-2 w-full max-w-xs rounded-md text-[#000435] bg-white dark:text-white dark:bg-[#000435] border border-sky-400 focus:outline-none focus:ring-2 focus:ring-blue-500"
168
- />
169
+ onKeyDown = { ( event ) => {
170
+ if ( event . key == "Enter" ) {
171
+ handleSearch ( )
172
+ }
173
+ } }
174
+ />
169
175
< button
170
176
onClick = { handleSearch }
171
177
className = "bg-blue-500 text-white px-4 py-2 rounded ml-2 hover:bg-blue-600 transition-colors duration-200"
You can’t perform that action at this time.
0 commit comments