Skip to content

Commit 7567661

Browse files
committed
fix(studio): warn of a tile gap inside the timeline scroller too
1 parent c039fae commit 7567661

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎packages/studio/src/hooks/useThumbnailStripSize.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ const spanInView = (target: Element) => {
2222
};
2323
};
2424

25+
// scrollMargin widens the band inside the timeline's own scroller too; TypeScript's DOM types lack it.
26+
const GAP_WARNING: IntersectionObserverInit & { scrollMargin: string } = {
27+
rootMargin: `0px ${IN_VIEW_CHUNK_PX / 2}px`,
28+
scrollMargin: `0px ${IN_VIEW_CHUNK_PX / 2}px`,
29+
};
30+
2531
const merge = (patch: Partial<StripSize>) => (prev: StripSize) => {
2632
const next = { ...prev, ...patch };
2733
return (Object.keys(next) as (keyof StripSize)[]).every((key) => next[key] === prev[key])
@@ -58,7 +64,7 @@ export function useThumbnailStripSize() {
5864
? null
5965
: new IntersectionObserver(
6066
(entries) => entries.some((entry) => entry.isIntersecting) && remeasure(),
61-
{ rootMargin: `0px ${IN_VIEW_CHUNK_PX / 2}px` },
67+
GAP_WARNING,
6268
),
6369
);
6470

0 commit comments

Comments
 (0)