mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Cancel animation when a custom Timeline is used (#35567)
Follow up to #35559. The clean up function of the custom timeline doesn't necessarily clean up the animation. Just the timeline's internal state. This affects Firefox which doesn't support ScrollTimeline so uses the polyfill's custom timeline.
This commit is contained in:
1 parent
d343c39cce
commit
d29087523a
2 files changed
+3
No files matched your search
@@ -150,6 +150,8 @@ export default function Page({url, navigate}) {
|
||||
const cleanup1 = timeline.animate(animation1);
|
||||
const cleanup2 = timeline.animate(animation2);
|
||||
return () => {
|
||||
animation1.cancel();
|
||||
animation2.cancel();
|
||||
cleanup1();
|
||||
cleanup2();
|
||||
};
|
||||
|
||||
@@ -2525,6 +2525,7 @@ function animateGesture(
|
||||
delay: reverse ? rangeEnd : rangeStart,
|
||||
duration: reverse ? rangeStart - rangeEnd : rangeEnd - rangeStart,
|
||||
});
|
||||
viewTransitionAnimations.push(animation);
|
||||
// Let the custom timeline take control of driving the animation.
|
||||
const cleanup = timeline.animate(animation);
|
||||
if (cleanup) {
|
||||
|
||||
Reference in new issue
Block a user