diff --git a/components/layout/stacked-marquee-section.tsx b/components/layout/stacked-marquee-section.tsx index 8ab7889..a223035 100644 --- a/components/layout/stacked-marquee-section.tsx +++ b/components/layout/stacked-marquee-section.tsx @@ -85,7 +85,11 @@ const DEFAULT_ROWS: MarqueeRow[] = [ }, ]; -function MarqueeRowTrack({ items, direction, duration = 24 }: MarqueeRow) { +function MarqueeRowTrack({ + items, + direction, + duration = 24, +}: MarqueeRow) { const shouldReduceMotion = useReducedMotion(); const viewportRef = useRef(null); const segmentRef = useRef(null); @@ -103,7 +107,7 @@ function MarqueeRowTrack({ items, direction, duration = 24 }: MarqueeRow) { } const measure = () => { - const nextSegmentWidth = segment.scrollWidth; + const nextSegmentWidth = segment.getBoundingClientRect().width; const viewportWidth = viewport.clientWidth; if (!nextSegmentWidth || !viewportWidth) { @@ -149,7 +153,11 @@ function MarqueeRowTrack({ items, direction, duration = 24 }: MarqueeRow) { }); return ( -
+
0} + dir="ltr" > {items.map((item, itemIndex) => (
{item}