Skip to content

Commit 18198fb

Browse files
committed
Comments
1 parent 73a5fec commit 18198fb

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/sdk-components-animation/src/scroll.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ const createSelector = (id: string) => `[${componentAttributeId}="${id}"] > *`;
1919
const cartesian = <A, B>(a: A[], b: B[]) =>
2020
a.flatMap((x) => b.map((y) => [x, y] as const));
2121

22-
// See also WAAPI has bug https://issues.chromium.org/issues/40929569#comment9
23-
// so we are using calc even it it's not needed in some cases
2422
const getScrollRangeValue = ([name, value]: ScrollRangeValue) => {
23+
// See also WAAPI has bug https://issues.chromium.org/issues/40929569#comment9
24+
// so we are using calc even it it's not needed in some cases
2525
if (name === "start") {
2626
return `calc(0% + ${toValue(value)})`;
2727
}

packages/sdk-components-animation/src/shared/animation-types.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ type KeyframeEffectOptions = {
8484
* - "end" → `calc(100% - range)`
8585
*/
8686
type ScrollNamedRange = "start" | "end";
87+
88+
/**
89+
* Scroll does not support https://drafts.csswg.org/scroll-animations/#named-ranges
90+
* However, for simplicity and type unification with the view, we will use the names "start" and "end,"
91+
* See ScrollNamedRange type for more information.
92+
*/
8793
export type ScrollRangeValue = [name: ScrollNamedRange, value: RangeUnitValue];
8894

8995
type ScrollRangeOptions = {

0 commit comments

Comments
 (0)