From 38adb47fb94bf2f49f5a211aafa60055a19d0fea Mon Sep 17 00:00:00 2001 From: Sofia Bilous Date: Tue, 17 Oct 2023 20:13:33 +0300 Subject: [PATCH] add enter-press --- .../src/components/HeaderFooter/header/navbar/SearchBox.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/FrontEnd/src/components/HeaderFooter/header/navbar/SearchBox.jsx b/FrontEnd/src/components/HeaderFooter/header/navbar/SearchBox.jsx index afb10fd55..af7c8222c 100644 --- a/FrontEnd/src/components/HeaderFooter/header/navbar/SearchBox.jsx +++ b/FrontEnd/src/components/HeaderFooter/header/navbar/SearchBox.jsx @@ -23,6 +23,11 @@ function SearchBox() { type="text" placeholder="Пошук" onChange={(e) => setSearchTerm(e.target.value)} + onKeyDown={(e) => { + if (e.key === 'Enter') { + handleSearch(searchTerm, searchPage); + } + }} />