diff --git a/web/src/components/SearchBar.tsx b/web/src/components/SearchBar.tsx index 547efbd2..818fc619 100644 --- a/web/src/components/SearchBar.tsx +++ b/web/src/components/SearchBar.tsx @@ -12,6 +12,7 @@ const SearchBar = () => { const memoType = locationStore.state.query.type; const [queryText, setQueryText] = useState(""); const inputRef = useRef(null); + const [isFocus, setIsFocus] = useState(false); useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { @@ -53,8 +54,16 @@ const SearchBar = () => { locationStore.setTextQuery(text.length === 0 ? undefined : text); }; + const handleFocus = () => { + setIsFocus(true); + }; + + const handleBlur = () => { + setIsFocus(false); + }; + return ( -
+
{ ref={inputRef} value={queryText} onChange={handleTextQueryInput} + onFocus={handleFocus} + onBlur={handleBlur} />
diff --git a/web/src/less/search-bar.less b/web/src/less/search-bar.less index 73491964..0c350951 100644 --- a/web/src/less/search-bar.less +++ b/web/src/less/search-bar.less @@ -8,6 +8,12 @@ } } + &.is-focus { + > .quickly-action-wrapper { + @apply flex; + } + } + > .search-bar-inputer { @apply h-9 flex flex-row justify-start items-center w-full py-2 px-3 sm:px-4 rounded-full sm:rounded-lg bg-zinc-200 dark:bg-zinc-700;