fix FavGifSearch regression

This commit is contained in:
Vendicated 2025-09-09 03:56:53 +02:00
parent 8eabb11125
commit 479d01a1b9
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -30,6 +30,7 @@ interface SearchBarComponentProps {
onClear: () => void; onClear: () => void;
query: string; query: string;
placeholder: string; placeholder: string;
className?: string;
} }
type TSearchBarComponent = type TSearchBarComponent =
@ -147,7 +148,7 @@ function SearchBar({ instance, SearchBarComponent }: { instance: Instance; Searc
// scroll back to top // scroll back to top
ref.current?.containerRef?.current ref.current?.containerRef?.current
.closest("#gif-picker-tab-panel") ?.closest("#gif-picker-tab-panel")
?.querySelector("[class|=\"content\"]") ?.querySelector("[class|=\"content\"]")
?.firstElementChild?.scrollTo(0, 0); ?.firstElementChild?.scrollTo(0, 0);
@ -177,6 +178,7 @@ function SearchBar({ instance, SearchBarComponent }: { instance: Instance; Searc
ref={ref} ref={ref}
autoFocus={true} autoFocus={true}
size="md" size="md"
className=""
onChange={onChange} onChange={onChange}
onClear={() => { onClear={() => {
setQuery(""); setQuery("");