File tree 1 file changed +12
-2
lines changed
packages/react-dom-bindings/src/client
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1943,6 +1943,7 @@ export function startGestureTransition(
1943
1943
const timing = effect . getTiming ( ) ;
1944
1944
const duration =
1945
1945
typeof timing . duration === 'number' ? timing . duration : 0 ;
1946
+ // TODO: Consider interation count higher than 1.
1946
1947
const durationWithDelay = timing . delay + duration ;
1947
1948
if ( durationWithDelay > longestDuration ) {
1948
1949
longestDuration = durationWithDelay ;
@@ -2003,10 +2004,19 @@ export function startGestureTransition(
2003
2004
const timing = effect . getTiming ( ) ;
2004
2005
const duration =
2005
2006
typeof timing . duration === 'number' ? timing . duration : 0 ;
2006
- const adjustedRangeStart =
2007
+ let adjustedRangeStart =
2007
2008
rangeEnd - ( duration + timing . delay ) * durationToRangeMultipler ;
2008
- const adjustedRangeEnd =
2009
+ let adjustedRangeEnd =
2009
2010
rangeEnd - timing . delay * durationToRangeMultipler ;
2011
+ if (
2012
+ timing . direction === 'reverse' ||
2013
+ timing . direction === 'alternate-reverse'
2014
+ ) {
2015
+ // This animation was originally in reverse so we have to play it in flipped range.
2016
+ const temp = adjustedRangeStart ;
2017
+ adjustedRangeStart = adjustedRangeEnd ;
2018
+ adjustedRangeEnd = temp ;
2019
+ }
2010
2020
animateGesture (
2011
2021
effect . getKeyframes ( ) ,
2012
2022
// $FlowFixMe: Always documentElement atm.
You can’t perform that action at this time.
0 commit comments