Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,7 @@ function animateGesture(
moveOldFrameIntoViewport(keyframes[0]);
}
const reverse = rangeStart > rangeEnd;
const anim = targetElement.animate(keyframes, {
targetElement.animate(keyframes, {
pseudoElement: pseudoElement,
// Set the timeline to the current gesture timeline to drive the updates.
timeline: timeline,
Expand All @@ -1764,20 +1764,14 @@ function animateGesture(
easing: 'linear',
// We fill in both direction for overscroll.
fill: 'both',
// We play all gestures in reverse, except if we're in reverse direction
// in which case we need to play it in reverse of the reverse.
direction: reverse ? 'normal' : 'reverse',
// Range start needs to be higher than range end. If it goes in reverse
// we reverse the whole animation below.
rangeStart: (reverse ? rangeEnd : rangeStart) + '%',
rangeEnd: (reverse ? rangeStart : rangeEnd) + '%',
});
if (!reverse) {
// We play all gestures in reverse, except if we're in reverse direction
// in which case we need to play it in reverse of the reverse.
anim.reverse();
// In Safari, there's a bug where the starting position isn't immediately
// picked up from the ScrollTimeline for one frame.
// $FlowFixMe[cannot-resolve-name]
anim.currentTime = CSS.percent(100);
}
}

export function startGestureTransition(
Expand Down