Repository navigation
Description
If you haven't already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.2.62-5
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers): applausetester+omqq1@applause.expensifail.com
Issue reported by: Applause - Internal Team
Action Performed:
- Open app and login
- Navigate to Account > Profile > Display name
- Perform swipe-back gesture
Expected Result:
When performing the swipe-back gesture in Safari on iPhone, the previous screen should not appear. Navigation to the previous screen occurs smoothly, without flickering or momentary display of previous content
Actual Result:
When performing the swipe-back gesture in Safari on iPhone, the previous screen briefly flickers upon returning. This occurs on any screen of the app
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
- MacOS: Desktop
Platforms Tested:
On which of our officially supported platforms was this issue tested:- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
- MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
Bug7012224_1763999993924.ScreenRecording_11-24-2025_17-52-51_1.mp4
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021993123218832684990
- Upwork Job ID: 1993123218832684990
- Last Price Increase: 2025-12-02
- Automatic offers:
- aimane-chnaif | Reviewer | 109688488
- LorenzoBloedow | Contributor | 109688489
Issue Owner
Current Issue Owner: @aimane-chnaifMetadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
melvin-bot commentedon Nov 24, 2025
Triggered auto assignment to @jliexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.jliexpensify commentedon Nov 24, 2025
Android <> iOS swapsies, as Kadie has a physical iPhone to test
[-]Gesture - Safari on iPhone flickers previous screen on swipe-back gesture[/-][+][$250] Gesture - Safari on iPhone flickers previous screen on swipe-back gesture[/+]melvin-bot commentedon Nov 25, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021993123218832684990
melvin-bot commentedon Nov 25, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif (
External)197 remaining items
Burapa-J commentedon Nov 6, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On iOS Safari (mobile web), when navigating back from a Right Hand Panel (RHP) subpage (for example, Account > Profile > Display name back to Profile) using iOS Safari's native left-edge swipe-back gesture, the dismissed screen briefly flickers back onto the screen and slides out a second time after the native swipe gesture completes.
What is the root cause of that problem?
Safari's Native Swipe-Back Snapshot Runs Before React Navigation's
closingRouteKeysSpring Animation (src/libs/Navigation/AppNavigator/useRHPScreenOptions.ts:73&src/libs/Navigation/AppNavigator/ModalStackNavigators/useModalStackScreenOptions.ts:90):isSmallScreenWidth === true),useRHPScreenOptions.ts:73anduseModalStackScreenOptions.ts:90pass:transitionSpecisundefined,@react-navigation/stackfalls back toTransitionSpecs.TransitionIOSSpec(animation: 'spring', ~500ms).ViewGestureControllervisually slides the current page over a snapshot of the previous page and then fireswindow.popstatewithPopStateEvent.hasUAVisualTransition === true.popstate,StackViewplaces the popped route intoclosingRouteKeysand starts its own 500msAnimated.springslide-out transition—causing the dismissed screen to flash back into view and animate off-screen a second time.Why the Existing
@react-navigation/stackPatch Fails on Modern iOS Safari (patches/react-navigation/@react-navigation+stack+7.11.2+001+edge-drag-gesture.patch):Expensify already maintains
@react-navigation+stack+7.11.2+001+edge-drag-gesture.patch(from#22678/#64155) specifically to suppress this double animation, but it fails for three reasons:edgeDragGestureMonitor.jschecksif (pageX < 0) justFinishedEdgeGestureFromLeft = true;ontouchend. Modern iOS Safari never dispatches negativetouchend.pageXvalues during history swipe gestures (in fact, WebKit intercepts the gesture and either cancels touch events viatouchcancelor firespopstatewithe.hasUAVisualTransition === true), sogetIsEdgeDragGesture()always returnsfalse.Animated.springignoresduration: 0: InCard.js, the patch passesduration: 0intospec.config, but whenspec.animation === 'spring'(which is the fallback onisSmallScreenWidth),Animated.springignoresdurationand runs the full spring physics simulation anyway.pageX <= 30without triggering a history pop (e.g. an aborted swipe or tapping a left-aligned control), setting a flag ontouchend/touchcancelwithout verifyingpopstateor clearing it after the frame causes the next normal in-app push/pop to lose its animation.What changes do you think we should make in order to solve the problem?
Update
patches/react-navigation/@react-navigation+stack+7.11.2+001+edge-drag-gesture.patch(andpatches/react-navigation/details.md):Detect History Swipe-Back Reliably in
edgeDragGestureMonitor.jsUsingPopStateEvent.hasUAVisualTransition+ Left-Edge Touch Fallback:window.addEventListener('popstate', ...)in capture phase so it runs before React Navigation's history listener:justFinishedEdgeGestureFromLeft = truewhenevent.hasUAVisualTransition === trueOR when a touch began within the left edge (touchStartX <= 30) and ended viatouchcancel/touchendimmediately prior topopstate.justFinishedEdgeGestureFromLeft = falseinsiderequestAnimationFrameafter thepopstateturn so normal button-driven navigations are never affected:Force
Animated.timingwithduration: 0inCard.jsWhengetIsEdgeDragGesture()Istrue:In
@react-navigation/stack/lib/module/views/Stack/Card.js, whengetIsEdgeDragGesture()istrue, switch the animation driver fromAnimated.springtoAnimated.timingwith{toValue, duration: 0, useNativeDriver}so the closing card finishes instantaneously on the same framepopstatefires instead of running a 500ms spring animation.What alternative solutions did you explore? (Optional)
e.hasUAVisualTransitioninCard.jswithout handlingAnimated.spring: BecauseisSmallScreenWidthleavestransitionSpec: undefinedinuseRHPScreenOptions.ts:73,@react-navigation/stackusesTransitionIOSSpec(animation: 'spring'). Passingduration: 0toAnimated.springis a no-op;Card.jsmust also useAnimated.timingwhengetIsEdgeDragGesture()istrue.animation: 'none'globally on iOS Safari inuseRHPScreenOptions.ts: Removes slide transitions when the user taps the in-app header Back button or opens an RHP modal via a tap. Updatingedge-drag-gesture.patchsuppresses the animation strictly when the browser has already performed the native swipe visual transition.aimane-chnaif commentedon Nov 6, 2026
Not overdue
jeffrey-graham commentedon Nov 6, 2026
melvin-bot commentedon Nov 6, 2026
bonnhatnguyen commentedon Nov 7, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On iPhone Safari (iOS mWeb), when navigating to a screen inside the Right Hand Panel (e.g. Account > Profile > Display name) and performing iOS Safari's native left-edge swipe-back gesture, the dismissed screen briefly flashes back onto the viewport and slides out a second time after Safari's native swipe transition completes.
What is the root cause of that problem?
When the user swipes back from the left edge in iOS Safari, WebKit runs its own native visual snapshot transition and then dispatches
window.popstateonce the gesture finishes. At that point, the browser has already visually completed the transition to the previous screen, but@react-navigation/stackreacts to the state change by keeping the popped route inclosingRouteKeysand running its own JS card-closing animation fromprogress = 1to0.Expensify added
patches/react-navigation/@react-navigation+stack+7.11.2+001+edge-drag-gesture.patch(edgeDragGestureMonitor.jsandCard.js) specifically to suppress@react-navigation/stack's duplicate animation after an iOS Safari edge swipe, but two bugs in the current patch and RHP screen options prevent it from working:edgeDragGestureMonitor.jsrelies ontouchendhavingpageX < 0, which no longer fires on modern iOS Safari (patches/react-navigation/@react-navigation+stack+7.11.2+001+edge-drag-gesture.patch:31-37):On modern iOS Safari (iOS 16.4+), WebKit either does not dispatch
touchendwith a negativepageXfor a back-swipe gesture or dispatchespopstatewithPopStateEvent.hasUAVisualTransition === true. BecausepageX < 0is false ontouchend,expectingTouchendis set tofalseat line 40 whilejustFinishedEdgeGestureFromLeftstaysfalse, sogetIsEdgeDragGesture()returnsfalsewhenCard.jsstarts closing!Even when
getIsEdgeDragGesture()returnstrue,Card.jsonly setsduration: 0, which is ignored byAnimated.springon narrow layout (Card.js:152&src/libs/Navigation/AppNavigator/useRHPScreenOptions.ts:73):src/libs/Navigation/AppNavigator/useRHPScreenOptions.ts:73(anduseModalStackScreenOptions.ts/useRootNavigatorScreenOptions.ts), narrow mWeb viewports pass:transitionSpecisundefined,@react-navigation/stackfalls back toSlideFromRightIOS.transitionSpec(TransitionSpecs.TransitionIOSSpec), which usesanimation: 'spring'(Animated.springwithstiffness: 1000, damping: 500, mass: 3).Card.js:149-156:animationisAnimated.spring, passingduration: 0in the config object is completely ignored byAnimated.spring! Furthermore, starting an asynchronous animation onpopstatestill paints at least one frame with the closing card atprogress = 1beforeonFinish()removes the route fromclosingRouteKeys.What changes do you think we should make in order to solve the problem?
We can fix this cleanly in either of two ways (depending on whether we want to keep in-app button slide animations on iOS Safari or align RHP with
useSplitNavigatorScreenOptions.ts):Option A (Recommended — Fix
edge-drag-gesture.patchso native Safari swipe-back/forward settles immediately while keeping in-app button animations):edgeDragGestureMonitor.js, listen towindow.addEventListener('popstate', (e) => { ... })and markjustFinishedEdgeGestureFromLeft = true(for 100ms) whenevere.hasUAVisualTransition === trueor a touch gesture starting near the screen edge (touchstartpageX <= 30or>= window.innerWidth - 30) is active whenpopstatefires.CardStack.js(getDerivedStateFromProps) orCard.js(animate), whengetIsEdgeDragGesture()istrue, skip adding popped routes toclosingRouteKeys(or useAnimated.timingwithduration: 0/ immediately setgesture.setValue(toValue)and invokeonFinish()synchronously) so the popped card is removed in the exact same commit aspopstatewithout painting a duplicate closing frame.Option B (Alternative — Disable RHP/Modal stack animations on Mobile Safari, matching
useSplitNavigatorScreenOptions.ts):As noted by
@aimane-chnaifin comment #86,useSplitNavigatorScreenOptions.tsalready checksisMobileSafari()and usesAnimations.NONE. Settinganimation: isMobileSafari() ? Animations.NONE : Animations.SLIDE_FROM_RIGHT(andenter: {kind: 'none'}whenisMobileSafari()) inuseRHPScreenOptions.ts,useModalStackScreenOptions.ts, anduseRootNavigatorScreenOptions.tsbypassesclosingRouteKeyson Mobile Safari altogether without touching the@react-navigation/stackpatch.Burapa-J commentedon Nov 8, 2026
Withdrawn — I'm withdrawing this proposal so I only hold one job at a time, per the contributor guidelines. Thank you for reviewing.
Original proposal
Proposal
Please re-state the problem that we are trying to solve in this issue.
On iOS Safari (mobile web), when navigating back from a Right Hand Panel (RHP) subpage (for example, Account > Profile > Display name back to Profile) using iOS Safari's native left-edge swipe-back gesture, the dismissed screen briefly flickers back onto the screen and slides out a second time after the native swipe gesture completes.
What is the root cause of that problem?
Safari's Native Swipe-Back Snapshot Runs Before React Navigation's
closingRouteKeysSpring Animation (src/libs/Navigation/AppNavigator/useRHPScreenOptions.ts:73&src/libs/Navigation/AppNavigator/ModalStackNavigators/useModalStackScreenOptions.ts:90):isSmallScreenWidth === true),useRHPScreenOptions.ts:73anduseModalStackScreenOptions.ts:90pass:transitionSpecisundefined,@react-navigation/stackfalls back toTransitionSpecs.TransitionIOSSpec(animation: 'spring', ~500ms).ViewGestureControllervisually slides the current page over a snapshot of the previous page and then fireswindow.popstatewithPopStateEvent.hasUAVisualTransition === true.popstate,StackViewplaces the popped route intoclosingRouteKeysand starts its own 500msAnimated.springslide-out transition—causing the dismissed screen to flash back into view and animate off-screen a second time.Why the Existing
@react-navigation/stackPatch Fails on Modern iOS Safari (patches/react-navigation/@react-navigation+stack+7.11.2+001+edge-drag-gesture.patch):Expensify already maintains
@react-navigation+stack+7.11.2+001+edge-drag-gesture.patch(from#22678/#64155) specifically to suppress this double animation, but it fails for three reasons:edgeDragGestureMonitor.jschecksif (pageX < 0) justFinishedEdgeGestureFromLeft = true;ontouchend. Modern iOS Safari never dispatches negativetouchend.pageXvalues during history swipe gestures (in fact, WebKit intercepts the gesture and either cancels touch events viatouchcancelor firespopstatewithe.hasUAVisualTransition === true), sogetIsEdgeDragGesture()always returnsfalse.Animated.springignoresduration: 0: InCard.js, the patch passesduration: 0intospec.config, but whenspec.animation === 'spring'(which is the fallback onisSmallScreenWidth),Animated.springignoresdurationand runs the full spring physics simulation anyway.pageX <= 30without triggering a history pop (e.g. an aborted swipe or tapping a left-aligned control), setting a flag ontouchend/touchcancelwithout verifyingpopstateor clearing it after the frame causes the next normal in-app push/pop to lose its animation.What changes do you think we should make in order to solve the problem?
Update
patches/react-navigation/@react-navigation+stack+7.11.2+001+edge-drag-gesture.patch(andpatches/react-navigation/details.md):Detect History Swipe-Back Reliably in
edgeDragGestureMonitor.jsUsingPopStateEvent.hasUAVisualTransition+ Left-Edge Touch Fallback:window.addEventListener('popstate', ...)in capture phase so it runs before React Navigation's history listener:justFinishedEdgeGestureFromLeft = truewhenevent.hasUAVisualTransition === trueOR when a touch began within the left edge (touchStartX <= 30) and ended viatouchcancel/touchendimmediately prior topopstate.justFinishedEdgeGestureFromLeft = falseinsiderequestAnimationFrameafter thepopstateturn so normal button-driven navigations are never affected:Force
Animated.timingwithduration: 0inCard.jsWhengetIsEdgeDragGesture()Istrue:In
@react-navigation/stack/lib/module/views/Stack/Card.js, whengetIsEdgeDragGesture()istrue, switch the animation driver fromAnimated.springtoAnimated.timingwith{toValue, duration: 0, useNativeDriver}so the closing card finishes instantaneously on the same framepopstatefires instead of running a 500ms spring animation.What alternative solutions did you explore? (Optional)
e.hasUAVisualTransitioninCard.jswithout handlingAnimated.spring: BecauseisSmallScreenWidthleavestransitionSpec: undefinedinuseRHPScreenOptions.ts:73,@react-navigation/stackusesTransitionIOSSpec(animation: 'spring'). Passingduration: 0toAnimated.springis a no-op;Card.jsmust also useAnimated.timingwhengetIsEdgeDragGesture()istrue.animation: 'none'globally on iOS Safari inuseRHPScreenOptions.ts: Removes slide transitions when the user taps the in-app header Back button or opens an RHP modal via a tap. Updatingedge-drag-gesture.patchsuppresses the animation strictly when the browser has already performed the native swipe visual transition.cocvn157 commentedon Nov 8, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On iOS Safari (mobile web), when navigating back (or forward) using Safari's native edge-swipe gesture—such as swiping from the left edge to return from an RHP page, workspace settings page, or report screen—the screen being dismissed briefly flashes on top again right after the swipe completes before disappearing.
What is the root cause of that problem?
When the user performs iOS Safari's native edge-swipe gesture, WebKit's
ViewGestureControllervisually animates a browser snapshot of the previous history entry and removes that snapshot on the first repaint after synchronouspopstatedispatch. However,patches/react-navigation/@react-navigation+stack+7.11.2+001+edge-drag-gesture.patchfails to unmount the dismissed screen during that synchronouspopstatecommit for three reasons:edgeDragGestureMonitor.js:handleTouchEndonly setsjustFinishedEdgeGestureFromLeft = truewhene.changedTouches[0].pageX < 0. On modern iOS Safari, when WebKit's native swipe recognizer claims the edge gesture, it either cancels DOM touches viatouchcancel(whichedgeDragGestureMonitor.jsdoes not listen to, leavingexpectingTouchend = truestuck!) or firestouchendwith a positivepageXwhere the finger lifted, and then dispatchespopstatewithevent.hasUAVisualTransition === true.StackView.getDerivedStateFromPropsstill puts the popped route intoclosingRouteKeys:getIsEdgeDragGesture()returnstrue,StackView.getDerivedStateFromProps(node_modules/@react-navigation/stack/lib/module/views/Stack/StackView.js:86-113) only checksgetAnimationEnabled(descriptor?.options.animation), which istrueon narrow layout (SlideFromRightIOS).StackViewappendspreviousFocusedRoutetoclosingRouteKeysand keeps it instate.routesfor an extra render cycle (Card.componentDidMount/componentDidUpdate->animate({closing: true})->onCloseRoute). On the synchronouspopstatecommit when Safari removes its swipe snapshot, the dismissed card is still mounted atprogress = 1(translateX(0)), causing the 1-frame flash.openingRouteKeys/replacingRouteKeyscleanup (StackView.js:107-108) is nested insideif (isAnimationEnabled(previousFocusedRoute.key)), so disabling animation without lifting that filter leaves the popped route key inopeningRouteKeys.Card.jspassesduration: 0toAnimated.spring:useRHPScreenOptions.ts:73,useRootNavigatorScreenOptions.ts:65, anduseModalStackScreenOptions.ts:90useSlideFromRightIOS(TransitionIOSSpec, wherespec.animation === 'spring'). InCard.js:146-152,Animated.springignoresduration: 0completely because spring animations are physics-driven (stiffness/damping/mass).What changes do you think we should make in order to solve the problem?
Update
patches/react-navigation/@react-navigation+stack+7.11.2+001+edge-drag-gesture.patchacrossedgeDragGestureMonitor.js,StackView.js, andCard.js:edgeDragGestureMonitor.js— Detect edge touches (touchstart/touchend/touchcancel) and capture-phasepopstate(event.hasUAVisualTransition):Track touches starting within
24pxof the left or right viewport edge (pageX <= 24 || pageX >= window.innerWidth - 24), handle bothtouchendandtouchcancel, and register a capture-phasewindow.addEventListener('popstate', ..., true)listener:StackView.js— SkipclosingRouteKeys/openingRouteKeyssynchronously duringgetDerivedStateFromPropswhengetIsEdgeDragGesture()istrue, and always clean upopeningRouteKeys/replacingRouteKeyson pop:In
StackView.getDerivedStateFromProps, checkgetIsEdgeDragGesture()insideisAnimationEnabledand clear any in-flightclosingRouteKeys/replacingRouteKeysso the popped route is removed fromstate.routesin the exact same synchronous render pass aspopstate:And on pop (
StackView.js:98-108), filterpreviousFocusedRoute.keyout ofopeningRouteKeysandreplacingRouteKeysbefore theif (isAnimationEnabled(previousFocusedRoute.key) && ...)check so a swipe-back during an unfinished push transition cleans up immediately.Card.js— Fall back toAnimated.timingwithduration: 0whenisEdgeDragGestureistrue:In
Card.animate(Card.js:146), avoidAnimated.springwhenisEdgeDragGestureistrue:What alternative solutions did you explore? (Optional)
animation: 'none'inuseRootNavigatorScreenOptions/useRHPScreenOptions: rejected because button taps and in-app back button presses should keep their smooth slide transitions; only browser-driven edge-swipe history gestures should skip React Navigation's transition.Animated.springtoAnimated.timingwithduration: 0inCard.js: rejected becauseStackViewstill keeps the popped screen mounted inclosingRouteKeysduring thepopstatecommit frame beforeAnimated.timingsettles and callshandleCloseRoute.melvin-bot commentedon Nov 8, 2026
📣 @cocvn157! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
melvin-bot commentedon Nov 9, 2026
@aimane-chnaif Whoops! This issue is 2 days overdue. Let's get this updated quick!
samranahm commentedon Nov 9, 2026
@aimane-chnaif Friendly bump.
aimane-chnaif commentedon Nov 10, 2026
samranahmproposes the same approach asannaweber830: detect the swipe withpopstate.hasUAVisualTransition.The difference is where the check lives. It's in app code, not in a node_modules patch.
While the flag is up, every web stack renders with
animation: 'none', so the in-app back button keeps its slide.abbasifaizan70 commentedon Nov 10, 2026
@aimane-chnaif Can you check my proposal #75905 (comment). Already added demo and test branch there. Thanks
samranahm commentedon Nov 10, 2026
@aimane-chnaif That absolutely makes sense. The flag is only active for browser-handled swipe navigation, so
animation: 'none'prevents the duplicate animation while normal in-app back navigation keeps its slide. And this approach doesn’t require anynode_modulespatch or update to existing one.vance-engine commentedon Nov 14, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On iOS Safari (mWeb), performing a swipe-back gesture to return to a previous screen (such as navigating to Account > Profile > Display name and swiping back) causes the previous screen to flicker briefly upon returning.
What is the root cause of that problem?
Mobile Safari implements a native interactive swipe-back gesture that renders cached page snapshots during gesture execution. When the gesture completes and the browser triggers a
popstateevent, the application synchronizes its navigation state (as observed through root navigation listeners such as insrc/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx#L127-L130). If the React Navigation stack on web runs card transition animations or re-renders un-memoized screens simultaneously with Safari's native snapshot completion, a momentary visual flicker occurs between the browser's snapshot and the updated view layer.What changes do you think we should make in order to solve the problem?
To eliminate the flicker, the web navigation stack should disable transition animations during browser pop/back actions on iOS Safari, or configure
overscroll-behavior-x: noneon the root viewport container to prevent native swipe-history conflicts if stack gestures are handled in-app. Because the files defining the root navigation container, stack animation options, and viewport style rules are not included in the provided context, the precise fix cannot be applied to the available files without violating workspace boundary constraints.What alternative solutions did you explore? (Optional)
An alternative is suppressing native WebKit swipe gestures across the application via touch event listeners, though this removes the native feel of edge-swipe navigation for mobile web users.
melvin-bot commentedon Nov 14, 2026
📣 @vance-engine! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format: