From f78e00006a7ecb338bee2944af21f5477aed5872 Mon Sep 17 00:00:00 2001 From: Daniel Lazaro Date: Fri, 29 Aug 2025 16:54:27 -0400 Subject: [PATCH] Fix animation when scroll container has no overflow --- src/scroll-timeline-base.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/scroll-timeline-base.js b/src/scroll-timeline-base.js index 2c85492..b7a40da 100644 --- a/src/scroll-timeline-base.js +++ b/src/scroll-timeline-base.js @@ -473,7 +473,7 @@ export class ScrollTimeline { const maxScrollPos = calculateMaxScrollOffset(container, axis); return maxScrollPos > 0 ? CSS.percent(100 * scrollPos / maxScrollPos) - : CSS.percent(100); + : unresolved; } get __polyfill() { @@ -878,6 +878,10 @@ export class ViewTimeline extends ScrollTimeline { const offsets = range(this, 'cover'); if (!offsets) return unresolved; + + if (offsets.end === offsets.start) + return unresolved; + const progress = (scrollPos - offsets.start) / (offsets.end - offsets.start);