diff --git a/crates/lanspread-tauri-deno-ts/src/components/topbar/SearchField.tsx b/crates/lanspread-tauri-deno-ts/src/components/topbar/SearchField.tsx index 3af0e7d..88daf08 100644 --- a/crates/lanspread-tauri-deno-ts/src/components/topbar/SearchField.tsx +++ b/crates/lanspread-tauri-deno-ts/src/components/topbar/SearchField.tsx @@ -13,6 +13,7 @@ interface Props { */ export const SearchField = ({ value, onChange }: Props) => { const inputRef = useRef(null); + const clearClassName = value ? 'search-clear' : 'search-clear is-hidden'; useEffect(() => { const onKey = (e: KeyboardEvent) => { @@ -51,19 +52,19 @@ export const SearchField = ({ value, onChange }: Props) => { }} spellCheck={false} /> - {value && ( - - )} + / ); diff --git a/crates/lanspread-tauri-deno-ts/src/styles/launcher.css b/crates/lanspread-tauri-deno-ts/src/styles/launcher.css index 7d0dadf..48b9e12 100644 --- a/crates/lanspread-tauri-deno-ts/src/styles/launcher.css +++ b/crates/lanspread-tauri-deno-ts/src/styles/launcher.css @@ -304,6 +304,10 @@ color: var(--t-1); background: rgba(255, 255, 255, 0.08); } +.search-clear.is-hidden { + visibility: hidden; + pointer-events: none; +} .search-kbd { display: inline-grid; place-items: center;