mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-17 17:04:16 +02:00
fix overlayscrollbars init on loading state
This commit is contained in:
@@ -94,6 +94,13 @@ export function VirtualMultiSelect<T>({
|
|||||||
const { current: container } = listContainerRef;
|
const { current: container } = listContainerRef;
|
||||||
if (!container) return;
|
if (!container) return;
|
||||||
|
|
||||||
|
const isListVisible = !isLoading && stableOptions.length > 0;
|
||||||
|
|
||||||
|
if (!isListVisible) {
|
||||||
|
osInstance()?.destroy();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const viewport = container.firstElementChild as HTMLElement;
|
const viewport = container.firstElementChild as HTMLElement;
|
||||||
if (!viewport) return;
|
if (!viewport) return;
|
||||||
|
|
||||||
@@ -105,7 +112,7 @@ export function VirtualMultiSelect<T>({
|
|||||||
});
|
});
|
||||||
|
|
||||||
return () => osInstance()?.destroy();
|
return () => osInstance()?.destroy();
|
||||||
}, [initialize, osInstance, stableOptions.length]);
|
}, [initialize, osInstance, isLoading, stableOptions.length]);
|
||||||
|
|
||||||
const handleToggle = useCallback(
|
const handleToggle = useCallback(
|
||||||
(optionValue: string) => {
|
(optionValue: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user