fix: regression - search results not visible until scroll (#23321)

This commit is contained in:
Min Idzelis 2025-10-28 15:15:24 -04:00 committed by GitHub
parent 52596255c8
commit 8d25f81bec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -96,18 +96,18 @@
let shiftKeyIsDown = $state(false); let shiftKeyIsDown = $state(false);
let lastAssetMouseEvent: TimelineAsset | null = $state(null); let lastAssetMouseEvent: TimelineAsset | null = $state(null);
let slidingWindow = $state({ top: 0, bottom: 0 }); let scrollTop = $state(0);
let slidingWindow = $derived.by(() => {
const updateSlidingWindow = () => { const top = (scrollTop || 0) - slidingWindowOffset;
const v = $state.snapshot(viewport); const bottom = top + viewport.height;
const top = (document.scrollingElement?.scrollTop || 0) - slidingWindowOffset; return {
const bottom = top + v.height;
const w = {
top, top,
bottom, bottom,
}; };
slidingWindow = w; });
};
const updateSlidingWindow = () => (scrollTop = document.scrollingElement?.scrollTop ?? 0);
const debouncedOnIntersected = debounce(() => onIntersected?.(), 750, { maxWait: 100, leading: true }); const debouncedOnIntersected = debounce(() => onIntersected?.(), 750, { maxWait: 100, leading: true });
let lastIntersectedHeight = 0; let lastIntersectedHeight = 0;