File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
packages/react-reconciler/src Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -307,6 +307,7 @@ import {
307307 transitionSuspendedTime ,
308308 clearBlockingTimers ,
309309 clearGestureTimers ,
310+ clearGestureUpdates ,
310311 clearTransitionTimers ,
311312 clampBlockingTimers ,
312313 clampGestureTimers ,
@@ -3531,6 +3532,11 @@ function commitRoot(
35313532 // Gestures don't clear their lanes while the gesture is still active but it
35323533 // might not be scheduled to do any more renders and so we shouldn't schedule
35333534 // any more gesture lane work until a new gesture is scheduled.
3535+ if ( enableProfilerTimer && ( remainingLanes & GestureLane ) !== NoLanes ) {
3536+ // We need to clear any updates scheduled so that we can treat future updates
3537+ // as the cause of the render.
3538+ clearGestureUpdates ( ) ;
3539+ }
35343540 remainingLanes &= ~ GestureLane ;
35353541 }
35363542
Original file line number Diff line number Diff line change @@ -371,6 +371,16 @@ export function clearGestureTimers(): void {
371371 gestureClampTime = now ( ) ;
372372}
373373
374+ export function clearGestureUpdates ( ) : void {
375+ // Same as clearGestureTimers but doesn't reset the clamp time because we didn't
376+ // actually emit a render.
377+ gestureStartTime = - 1.1 ;
378+ gestureUpdateTime = - 1.1 ;
379+ gestureUpdateType = 0 ;
380+ gestureSuspendedTime = - 1.1 ;
381+ gestureEventIsRepeat = true ;
382+ }
383+
374384export function clampBlockingTimers ( finalTime : number ) : void {
375385 if ( ! enableProfilerTimer || ! enableComponentPerformanceTrack ) {
376386 return ;
You can’t perform that action at this time.
0 commit comments