From a66307b757eebe68ec5a4c18b838d23a759f624b Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Mon, 29 Jan 2024 21:11:08 +0800 Subject: [PATCH] Fixes + improvements to search UI --- src/components/ICONS.jsx | 1 + src/components/search-form.jsx | 42 ++++++++++++++++++++++++++++++---- src/pages/search.css | 12 ++++++++++ src/pages/search.jsx | 39 ++++++++++++++++++++++++++----- 4 files changed, 84 insertions(+), 10 deletions(-) diff --git a/src/components/ICONS.jsx b/src/components/ICONS.jsx index cbab0e2b..265b3c7b 100644 --- a/src/components/ICONS.jsx +++ b/src/components/ICONS.jsx @@ -99,4 +99,5 @@ export const ICONS = { speak: () => import('@iconify-icons/mingcute/radar-line'), building: () => import('@iconify-icons/mingcute/building-5-line'), history: () => import('@iconify-icons/mingcute/history-2-line'), + document: () => import('@iconify-icons/mingcute/document-line'), }; diff --git a/src/components/search-form.jsx b/src/components/search-form.jsx index 01ddceb9..5a57b304 100644 --- a/src/components/search-form.jsx +++ b/src/components/search-form.jsx @@ -73,6 +73,7 @@ const SearchForm = forwardRef((props, ref) => { autocomplete="off" autocorrect="off" autocapitalize="off" + spellcheck="false" onSearch={(e) => { if (!e.target.value) { setSearchParams({}); @@ -84,6 +85,9 @@ const SearchForm = forwardRef((props, ref) => { }} onFocus={() => { setSearchMenuOpen(true); + formRef.current + ?.querySelector('.search-popover-item') + ?.classList.add('focus'); }} onBlur={() => { setTimeout(() => { @@ -178,8 +182,33 @@ const SearchForm = forwardRef((props, ref) => { }} />