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