From fb481fc6a5211f66bf68087406fa6064bb9ca8d8 Mon Sep 17 00:00:00 2001
From: real-zephex <zephex-1@outlook.com>
Date: Tue, 7 May 2024 10:21:36 +0530
Subject: didn't like it

---
 src/app/movies/components/search.jsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/app/movies/components/search.jsx')

diff --git a/src/app/movies/components/search.jsx b/src/app/movies/components/search.jsx
index 20f8cac..6514b76 100644
--- a/src/app/movies/components/search.jsx
+++ b/src/app/movies/components/search.jsx
@@ -24,9 +24,9 @@ export default function SEARCH_COMPONENT() {
 				<input
 					placeholder="Enter movie title here"
 					onChange={(event) => setTitle(event.target.value)}
-					onKeyDown={async (event) => {
-						if (event.code !== 8) {
-							await fetch_results(title);
+					onKeyDown={async (e) => {
+						if ((e.key === "Enter" || e.code === 13) && title) {
+							await fetch_results(e.target.value);
 						}
 					}}
 				></input>
-- 
cgit v1.2.3

