From 8d047e3db0f42dc7371aa3193be9469dadfcf277 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Wed, 2 Mar 2022 11:34:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/NEXT/components/SearchInput.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/themes/NEXT/components/SearchInput.js b/themes/NEXT/components/SearchInput.js index 2b4e88be..99e54ec1 100644 --- a/themes/NEXT/components/SearchInput.js +++ b/themes/NEXT/components/SearchInput.js @@ -15,7 +15,8 @@ const SearchInput = ({ currentTag, currentSearch, cRef }) => { } } }) - const handleSearch = (key) => { + const handleSearch = () => { + const key = searchInputRef.current.value if (key && key !== '') { setLoadingState(true) // router.push({ pathname: '/search/' + key }).then(r => { @@ -62,7 +63,7 @@ const SearchInput = ({ currentTag, currentSearch, cRef }) => { {(showClean && )}
+ onClick={handleKeyUp}>