From 8106b270f763d2ee51c051bf5078cd017d954333 Mon Sep 17 00:00:00 2001 From: Seo San Date: Thu, 5 Dec 2024 19:12:38 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix:=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95=20=EA=B2=80=EC=83=89?= =?UTF-8?q?=EC=96=B4=EB=A1=9C=20tt=ED=98=B9=EC=9D=80=20=E3=85=85=E3=85=85?= =?UTF-8?q?=EB=A5=BC=20=EC=9E=85=EB=A0=A5=ED=95=A0=20=EA=B2=BD=EC=9A=B0=20?= =?UTF-8?q?=EC=9D=BC=EC=A0=95=20=EC=8B=9C=EA=B0=84=EC=9D=B4=20=ED=9D=90?= =?UTF-8?q?=EB=A5=B8=20=ED=9B=84=20=EC=97=90=EB=9F=AC=EA=B0=80=20=EB=82=98?= =?UTF-8?q?=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FE/src/components/Search/index.tsx | 5 ++--- FE/src/utils/format.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/FE/src/components/Search/index.tsx b/FE/src/components/Search/index.tsx index eaad617..248cd2b 100644 --- a/FE/src/components/Search/index.tsx +++ b/FE/src/components/Search/index.tsx @@ -41,7 +41,7 @@ export default function SearchModal() { // 결과가 없으면 변환된 검색어로 검색 if (originalResults.length === 0 && convertedSearch) { - return getSearchResults(formatNoSpecialChar(convertedSearch)); + return await getSearchResults(formatNoSpecialChar(convertedSearch)); } return originalResults; @@ -60,7 +60,6 @@ export default function SearchModal() { if (!isOpen) return null; const isSearching = isLoading || isFetching || isDebouncing; - const showSearchResults = searchInput && !isSearching && data; return (
@@ -102,7 +101,7 @@ export default function SearchModal() {

) : ( - showSearchResults && + )} diff --git a/FE/src/utils/format.ts b/FE/src/utils/format.ts index 84cf02d..bd1dfe6 100644 --- a/FE/src/utils/format.ts +++ b/FE/src/utils/format.ts @@ -1,5 +1,5 @@ export const formatNoSpecialChar = (query: string) => { - return query.replace(/[^a-zA-Z0-9가-힣 ]|\\/g, ''); + return query.replace(/[^a-zA-Z0-9가-힣ㄱ-ㅎㅏ-ㅣ ]|\\/g, ''); }; export function formatTime(time: string) {