Skip to content

Commit 50d9868

Browse files
committed
Do not load polyfill in chrome
1 parent 65a8189 commit 50d9868

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

@types/scroll-timeline.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ interface ScrollTimelineOptions {
77

88
declare class ScrollTimeline extends AnimationTimeline {
99
constructor(options?: ScrollTimelineOptions);
10+
}
1011

11-
readonly source: Element | Document | null;
12-
readonly axis: ScrollAxis;
12+
declare class ViewTimeline extends ScrollTimeline {
13+
constructor(options?: ScrollTimelineOptions);
1314
}

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

+6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ import { use } from "react";
22

33
let clientPolyfillCache: null | Promise<void> = null;
44

5+
const fullfilledPromise = Promise.resolve();
6+
57
const polyfill = () => {
8+
if (typeof ViewTimeline !== "undefined") {
9+
return fullfilledPromise;
10+
}
11+
612
if (clientPolyfillCache === null) {
713
clientPolyfillCache = import(
814
// @ts-expect-error no types exists

0 commit comments

Comments
 (0)