File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
packages/react-dom-bindings/src/client Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1943,6 +1943,7 @@ export function startGestureTransition(
19431943 const timing = effect . getTiming ( ) ;
19441944 const duration =
19451945 typeof timing . duration === 'number' ? timing . duration : 0 ;
1946+ // TODO: Consider interation count higher than 1.
19461947 const durationWithDelay = timing . delay + duration ;
19471948 if ( durationWithDelay > longestDuration ) {
19481949 longestDuration = durationWithDelay ;
@@ -2003,10 +2004,16 @@ export function startGestureTransition(
20032004 const timing = effect . getTiming ( ) ;
20042005 const duration =
20052006 typeof timing . duration === 'number' ? timing . duration : 0 ;
2006- const adjustedRangeStart =
2007+ let adjustedRangeStart =
20072008 rangeEnd - ( duration + timing . delay ) * durationToRangeMultipler ;
2008- const adjustedRangeEnd =
2009+ let adjustedRangeEnd =
20092010 rangeEnd - timing . delay * durationToRangeMultipler ;
2011+ if ( timing . direction === 'reverse' || timing . direction === 'alternate-reverse' ) {
2012+ // This animation was originally in reverse so we have to play it in flipped range.
2013+ const temp = adjustedRangeStart ;
2014+ adjustedRangeStart = adjustedRangeEnd ;
2015+ adjustedRangeEnd = temp ;
2016+ }
20102017 animateGesture (
20112018 effect . getKeyframes ( ) ,
20122019 // $FlowFixMe: Always documentElement atm.
You can’t perform that action at this time.
0 commit comments