Skip to content

[$250] Gesture - Safari on iPhone flickers previous screen on swipe-back gesture #75905

Open

Description

@lanitochka17

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:

  1. Open app and login
  2. Navigate to Account > Profile > Display name
  3. 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

View all open jobs on GitHub

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 OwnerCurrent Issue Owner: @aimane-chnaif

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 24, 2025
  2. melvin-bot commented on Nov 24, 2025

    @melvin-bot

    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.

  3. jliexpensify commented on Nov 24, 2025

    @jliexpensify
    Contributor

    Android <> iOS swapsies, as Kadie has a physical iPhone to test

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Nov 25, 2025
  5. changed the title [-]Gesture - Safari on iPhone flickers previous screen on swipe-back gesture[/-] [+][$250] Gesture - Safari on iPhone flickers previous screen on swipe-back gesture[/+] on Nov 25, 2025
  6. melvin-bot commented on Nov 25, 2025

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Nov 25, 2025
  8. moved this to Bugs and Follow Up Issues in #expensify-bugson Nov 25, 2025
  9. melvin-bot commented on Nov 25, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif (External)

  10. 197 remaining items

  11. Burapa-J commented on Nov 6, 2026

    @Burapa-J

    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?

    1. Safari's Native Swipe-Back Snapshot Runs Before React Navigation's closingRouteKeys Spring Animation (src/libs/Navigation/AppNavigator/useRHPScreenOptions.ts:73 & src/libs/Navigation/AppNavigator/ModalStackNavigators/useModalStackScreenOptions.ts:90):

      • On narrow mobile web viewports (isSmallScreenWidth === true), useRHPScreenOptions.ts:73 and useModalStackScreenOptions.ts:90 pass:
        transitionSpec: isSmallScreenWidth ? undefined : RHP_WEB_TRANSITION_SPEC,
      • Because transitionSpec is undefined, @react-navigation/stack falls back to TransitionSpecs.TransitionIOSSpec (animation: 'spring', ~500ms).
      • When the user swipes back from the left edge in iOS Safari, WebKit's native ViewGestureController visually slides the current page over a snapshot of the previous page and then fires window.popstate with PopStateEvent.hasUAVisualTransition === true.
      • When React Navigation handles that popstate, StackView places the popped route into closingRouteKeys and starts its own 500ms Animated.spring slide-out transition—causing the dismissed screen to flash back into view and animate off-screen a second time.
    2. Why the Existing @react-navigation/stack Patch 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:

      • Broken gesture detection: edgeDragGestureMonitor.js checks if (pageX < 0) justFinishedEdgeGestureFromLeft = true; on touchend. Modern iOS Safari never dispatches negative touchend.pageX values during history swipe gestures (in fact, WebKit intercepts the gesture and either cancels touch events via touchcancel or fires popstate with e.hasUAVisualTransition === true), so getIsEdgeDragGesture() always returns false.
      • Animated.spring ignores duration: 0: In Card.js, the patch passes duration: 0 into spec.config, but when spec.animation === 'spring' (which is the fallback on isSmallScreenWidth), Animated.spring ignores duration and runs the full spring physics simulation anyway.
      • Stale flag across non-gesture navigations: If an edge touch starts near pageX <= 30 without triggering a history pop (e.g. an aborted swipe or tapping a left-aligned control), setting a flag on touchend/touchcancel without verifying popstate or 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 (and patches/react-navigation/details.md):

    1. Detect History Swipe-Back Reliably in edgeDragGestureMonitor.js Using PopStateEvent.hasUAVisualTransition + Left-Edge Touch Fallback:

      • Listen to window.addEventListener('popstate', ...) in capture phase so it runs before React Navigation's history listener:
        • Set justFinishedEdgeGestureFromLeft = true when event.hasUAVisualTransition === true OR when a touch began within the left edge (touchStartX <= 30) and ended via touchcancel / touchend immediately prior to popstate.
        • Automatically clear justFinishedEdgeGestureFromLeft = false inside requestAnimationFrame after the popstate turn so normal button-driven navigations are never affected:
        let touchStartedNearLeftEdge = false;
        let justFinishedEdgeGestureFromLeft = false;
        
        function setupEdgeDragGestureMonitor() {
          if (typeof window === 'undefined' || isSetup) {
            return;
          }
          isSetup = true;
          window.addEventListener('touchstart', (e) => {
            const touch = e.touches && e.touches[0];
            touchStartedNearLeftEdge = Boolean(touch && touch.pageX <= 30);
          }, {passive: true});
        
          window.addEventListener('popstate', (e) => {
            if (e.hasUAVisualTransition || touchStartedNearLeftEdge) {
              justFinishedEdgeGestureFromLeft = true;
              touchStartedNearLeftEdge = false;
              requestAnimationFrame(() => {
                justFinishedEdgeGestureFromLeft = false;
              });
            }
          }, true);
        }
    2. Force Animated.timing with duration: 0 in Card.js When getIsEdgeDragGesture() Is true:
      In @react-navigation/stack/lib/module/views/Stack/Card.js, when getIsEdgeDragGesture() is true, switch the animation driver from Animated.spring to Animated.timing with {toValue, duration: 0, useNativeDriver} so the closing card finishes instantaneously on the same frame popstate fires instead of running a 500ms spring animation.

    What alternative solutions did you explore? (Optional)

    • Only checking e.hasUAVisualTransition in Card.js without handling Animated.spring: Because isSmallScreenWidth leaves transitionSpec: undefined in useRHPScreenOptions.ts:73, @react-navigation/stack uses TransitionIOSSpec (animation: 'spring'). Passing duration: 0 to Animated.spring is a no-op; Card.js must also use Animated.timing when getIsEdgeDragGesture() is true.
    • Setting animation: 'none' globally on iOS Safari in useRHPScreenOptions.ts: Removes slide transitions when the user taps the in-app header Back button or opens an RHP modal via a tap. Updating edge-drag-gesture.patch suppresses the animation strictly when the browser has already performed the native swipe visual transition.
  12. aimane-chnaif commented on Nov 6, 2026

    @aimane-chnaif
    Contributor

    Not overdue

  13. jeffrey-graham commented on Nov 6, 2026

    @jeffrey-graham
  14. melvin-bot commented on Nov 6, 2026

    @melvin-bot
  15. bonnhatnguyen commented on Nov 7, 2026

    @bonnhatnguyen

    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.popstate once the gesture finishes. At that point, the browser has already visually completed the transition to the previous screen, but @react-navigation/stack reacts to the state change by keeping the popped route in closingRouteKeys and running its own JS card-closing animation from progress = 1 to 0.

    Expensify added patches/react-navigation/@react-navigation+stack+7.11.2+001+edge-drag-gesture.patch (edgeDragGestureMonitor.js and Card.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:

    1. edgeDragGestureMonitor.js relies on touchend having pageX < 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):

      const handleTouchEnd = e => {
        let changedTouches;
        const pageX = (changedTouches = e.changedTouches[0]) === null || changedTouches === void 0 ? void 0 : changedTouches.pageX;
        // PageX for gesture that would trigger navigation back is negative.
        if (pageX < 0) {
          ...
          justFinishedEdgeGestureFromLeft = true;

      On modern iOS Safari (iOS 16.4+), WebKit either does not dispatch touchend with a negative pageX for a back-swipe gesture or dispatches popstate with PopStateEvent.hasUAVisualTransition === true. Because pageX < 0 is false on touchend, expectingTouchend is set to false at line 40 while justFinishedEdgeGestureFromLeft stays false, so getIsEdgeDragGesture() returns false when Card.js starts closing!

    2. Even when getIsEdgeDragGesture() returns true, Card.js only sets duration: 0, which is ignored by Animated.spring on narrow layout (Card.js:152 & src/libs/Navigation/AppNavigator/useRHPScreenOptions.ts:73):

      • In src/libs/Navigation/AppNavigator/useRHPScreenOptions.ts:73 (and useModalStackScreenOptions.ts / useRootNavigatorScreenOptions.ts), narrow mWeb viewports pass:
        transitionSpec: isSmallScreenWidth ? undefined : RHP_WEB_TRANSITION_SPEC,
      • When transitionSpec is undefined, @react-navigation/stack falls back to SlideFromRightIOS.transitionSpec (TransitionSpecs.TransitionIOSSpec), which uses animation: 'spring' (Animated.spring with stiffness: 1000, damping: 500, mass: 3).
      • In Card.js:149-156:
        animation(gesture, {
          ...spec.config,
          duration: getIsEdgeDragGesture() ? 0 : spec.config && 'duration' in spec.config ? spec.config.duration : undefined,
          velocity,
          toValue,
          useNativeDriver,
          isInteraction: false
        }).start(({ finished }) => {
        Because animation is Animated.spring, passing duration: 0 in the config object is completely ignored by Animated.spring! Furthermore, starting an asynchronous animation on popstate still paints at least one frame with the closing card at progress = 1 before onFinish() removes the route from closingRouteKeys.

    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):

    1. Option A (Recommended — Fix edge-drag-gesture.patch so native Safari swipe-back/forward settles immediately while keeping in-app button animations):

      • In edgeDragGestureMonitor.js, listen to window.addEventListener('popstate', (e) => { ... }) and mark justFinishedEdgeGestureFromLeft = true (for 100ms) whenever e.hasUAVisualTransition === true or a touch gesture starting near the screen edge (touchstart pageX <= 30 or >= window.innerWidth - 30) is active when popstate fires.
      • In CardStack.js (getDerivedStateFromProps) or Card.js (animate), when getIsEdgeDragGesture() is true, skip adding popped routes to closingRouteKeys (or use Animated.timing with duration: 0 / immediately set gesture.setValue(toValue) and invoke onFinish() synchronously) so the popped card is removed in the exact same commit as popstate without painting a duplicate closing frame.
    2. Option B (Alternative — Disable RHP/Modal stack animations on Mobile Safari, matching useSplitNavigatorScreenOptions.ts):
      As noted by @aimane-chnaif in comment #86, useSplitNavigatorScreenOptions.ts already checks isMobileSafari() and uses Animations.NONE. Setting animation: isMobileSafari() ? Animations.NONE : Animations.SLIDE_FROM_RIGHT (and enter: {kind: 'none'} when isMobileSafari()) in useRHPScreenOptions.ts, useModalStackScreenOptions.ts, and useRootNavigatorScreenOptions.ts bypasses closingRouteKeys on Mobile Safari altogether without touching the @react-navigation/stack patch.

  16. Burapa-J commented on Nov 8, 2026

    @Burapa-J

    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?

    1. Safari's Native Swipe-Back Snapshot Runs Before React Navigation's closingRouteKeys Spring Animation (src/libs/Navigation/AppNavigator/useRHPScreenOptions.ts:73 & src/libs/Navigation/AppNavigator/ModalStackNavigators/useModalStackScreenOptions.ts:90):

      • On narrow mobile web viewports (isSmallScreenWidth === true), useRHPScreenOptions.ts:73 and useModalStackScreenOptions.ts:90 pass:
        transitionSpec: isSmallScreenWidth ? undefined : RHP_WEB_TRANSITION_SPEC,
      • Because transitionSpec is undefined, @react-navigation/stack falls back to TransitionSpecs.TransitionIOSSpec (animation: 'spring', ~500ms).
      • When the user swipes back from the left edge in iOS Safari, WebKit's native ViewGestureController visually slides the current page over a snapshot of the previous page and then fires window.popstate with PopStateEvent.hasUAVisualTransition === true.
      • When React Navigation handles that popstate, StackView places the popped route into closingRouteKeys and starts its own 500ms Animated.spring slide-out transition—causing the dismissed screen to flash back into view and animate off-screen a second time.
    2. Why the Existing @react-navigation/stack Patch 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:

      • Broken gesture detection: edgeDragGestureMonitor.js checks if (pageX < 0) justFinishedEdgeGestureFromLeft = true; on touchend. Modern iOS Safari never dispatches negative touchend.pageX values during history swipe gestures (in fact, WebKit intercepts the gesture and either cancels touch events via touchcancel or fires popstate with e.hasUAVisualTransition === true), so getIsEdgeDragGesture() always returns false.
      • Animated.spring ignores duration: 0: In Card.js, the patch passes duration: 0 into spec.config, but when spec.animation === 'spring' (which is the fallback on isSmallScreenWidth), Animated.spring ignores duration and runs the full spring physics simulation anyway.
      • Stale flag across non-gesture navigations: If an edge touch starts near pageX <= 30 without triggering a history pop (e.g. an aborted swipe or tapping a left-aligned control), setting a flag on touchend/touchcancel without verifying popstate or 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 (and patches/react-navigation/details.md):

    1. Detect History Swipe-Back Reliably in edgeDragGestureMonitor.js Using PopStateEvent.hasUAVisualTransition + Left-Edge Touch Fallback:

      • Listen to window.addEventListener('popstate', ...) in capture phase so it runs before React Navigation's history listener:
        • Set justFinishedEdgeGestureFromLeft = true when event.hasUAVisualTransition === true OR when a touch began within the left edge (touchStartX <= 30) and ended via touchcancel / touchend immediately prior to popstate.
        • Automatically clear justFinishedEdgeGestureFromLeft = false inside requestAnimationFrame after the popstate turn so normal button-driven navigations are never affected:
        let touchStartedNearLeftEdge = false;
        let justFinishedEdgeGestureFromLeft = false;
        
        function setupEdgeDragGestureMonitor() {
          if (typeof window === 'undefined' || isSetup) {
            return;
          }
          isSetup = true;
          window.addEventListener('touchstart', (e) => {
            const touch = e.touches && e.touches[0];
            touchStartedNearLeftEdge = Boolean(touch && touch.pageX <= 30);
          }, {passive: true});
        
          window.addEventListener('popstate', (e) => {
            if (e.hasUAVisualTransition || touchStartedNearLeftEdge) {
              justFinishedEdgeGestureFromLeft = true;
              touchStartedNearLeftEdge = false;
              requestAnimationFrame(() => {
                justFinishedEdgeGestureFromLeft = false;
              });
            }
          }, true);
        }
    2. Force Animated.timing with duration: 0 in Card.js When getIsEdgeDragGesture() Is true:
      In @react-navigation/stack/lib/module/views/Stack/Card.js, when getIsEdgeDragGesture() is true, switch the animation driver from Animated.spring to Animated.timing with {toValue, duration: 0, useNativeDriver} so the closing card finishes instantaneously on the same frame popstate fires instead of running a 500ms spring animation.

    What alternative solutions did you explore? (Optional)

    • Only checking e.hasUAVisualTransition in Card.js without handling Animated.spring: Because isSmallScreenWidth leaves transitionSpec: undefined in useRHPScreenOptions.ts:73, @react-navigation/stack uses TransitionIOSSpec (animation: 'spring'). Passing duration: 0 to Animated.spring is a no-op; Card.js must also use Animated.timing when getIsEdgeDragGesture() is true.
    • Setting animation: 'none' globally on iOS Safari in useRHPScreenOptions.ts: Removes slide transitions when the user taps the in-app header Back button or opens an RHP modal via a tap. Updating edge-drag-gesture.patch suppresses the animation strictly when the browser has already performed the native swipe visual transition.
  17. cocvn157 commented on Nov 8, 2026

    @cocvn157

    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 ViewGestureController visually animates a browser snapshot of the previous history entry and removes that snapshot on the first repaint after synchronous popstate dispatch. However, patches/react-navigation/@react-navigation+stack+7.11.2+001+edge-drag-gesture.patch fails to unmount the dismissed screen during that synchronous popstate commit for three reasons:

    1. Broken edge-gesture detection in edgeDragGestureMonitor.js:
      • handleTouchEnd only sets justFinishedEdgeGestureFromLeft = true when e.changedTouches[0].pageX < 0. On modern iOS Safari, when WebKit's native swipe recognizer claims the edge gesture, it either cancels DOM touches via touchcancel (which edgeDragGestureMonitor.js does not listen to, leaving expectingTouchend = true stuck!) or fires touchend with a positive pageX where the finger lifted, and then dispatches popstate with event.hasUAVisualTransition === true.
    2. StackView.getDerivedStateFromProps still puts the popped route into closingRouteKeys:
      • Even when getIsEdgeDragGesture() returns true, StackView.getDerivedStateFromProps (node_modules/@react-navigation/stack/lib/module/views/Stack/StackView.js:86-113) only checks getAnimationEnabled(descriptor?.options.animation), which is true on narrow layout (SlideFromRightIOS).
      • As a result, StackView appends previousFocusedRoute to closingRouteKeys and keeps it in state.routes for an extra render cycle (Card.componentDidMount / componentDidUpdate -> animate({closing: true}) -> onCloseRoute). On the synchronous popstate commit when Safari removes its swipe snapshot, the dismissed card is still mounted at progress = 1 (translateX(0)), causing the 1-frame flash.
      • Furthermore, if a swipe-back occurs while an opening transition is still settling, openingRouteKeys/replacingRouteKeys cleanup (StackView.js:107-108) is nested inside if (isAnimationEnabled(previousFocusedRoute.key)), so disabling animation without lifting that filter leaves the popped route key in openingRouteKeys.
    3. Card.js passes duration: 0 to Animated.spring:
      • On narrow viewports, useRHPScreenOptions.ts:73, useRootNavigatorScreenOptions.ts:65, and useModalStackScreenOptions.ts:90 use SlideFromRightIOS (TransitionIOSSpec, where spec.animation === 'spring'). In Card.js:146-152, Animated.spring ignores duration: 0 completely 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.patch across edgeDragGestureMonitor.js, StackView.js, and Card.js:

    1. edgeDragGestureMonitor.js — Detect edge touches (touchstart/touchend/touchcancel) and capture-phase popstate (event.hasUAVisualTransition):
      Track touches starting within 24px of the left or right viewport edge (pageX <= 24 || pageX >= window.innerWidth - 24), handle both touchend and touchcancel, and register a capture-phase window.addEventListener('popstate', ..., true) listener:
    window.addEventListener('popstate', (event) => {
      const hadRecentEdgeTouch = isEdgeTouchActive || (lastEdgeTouchTime > 0 && Date.now() - lastEdgeTouchTime <= 500);
      if (event?.hasUAVisualTransition === true || hadRecentEdgeTouch) {
        isEdgePopStateActive = true;
        scheduleReset();
      }
    }, true);
    1. StackView.js — Skip closingRouteKeys/openingRouteKeys synchronously during getDerivedStateFromProps when getIsEdgeDragGesture() is true, and always clean up openingRouteKeys/replacingRouteKeys on pop:
      In StackView.getDerivedStateFromProps, check getIsEdgeDragGesture() inside isAnimationEnabled and clear any in-flight closingRouteKeys/replacingRouteKeys so the popped route is removed from state.routes in the exact same synchronous render pass as popstate:
    const isEdgeDragGesture = getIsEdgeDragGesture();
    if (isEdgeDragGesture) {
      closingRouteKeys = [];
      replacingRouteKeys = [];
    }
    const isAnimationEnabled = key => !isEdgeDragGesture && getAnimationEnabled((props.descriptors[key] || state.descriptors[key])?.options.animation);

    And on pop (StackView.js:98-108), filter previousFocusedRoute.key out of openingRouteKeys and replacingRouteKeys before the if (isAnimationEnabled(previousFocusedRoute.key) && ...) check so a swipe-back during an unfinished push transition cleans up immediately.

    1. Card.js — Fall back to Animated.timing with duration: 0 when isEdgeDragGesture is true:
      In Card.animate (Card.js:146), avoid Animated.spring when isEdgeDragGesture is true:
    const isEdgeDragGesture = getIsEdgeDragGesture();
    const animation = spec.animation === 'spring' && !isEdgeDragGesture ? Animated.spring : Animated.timing;

    What alternative solutions did you explore? (Optional)

    • Disabling animations globally on mobile Safari via animation: 'none' in useRootNavigatorScreenOptions / 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.
    • Only switching Animated.spring to Animated.timing with duration: 0 in Card.js: rejected because StackView still keeps the popped screen mounted in closingRouteKeys during the popstate commit frame before Animated.timing settles and calls handleCloseRoute.
  18. melvin-bot commented on Nov 8, 2026

    @melvin-bot

    📣 @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:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  19. melvin-bot commented on Nov 9, 2026

    @melvin-bot

    @aimane-chnaif Whoops! This issue is 2 days overdue. Let's get this updated quick!

  20. samranahm commented on Nov 9, 2026

    @samranahm
    Contributor

    @aimane-chnaif Friendly bump.

  21. aimane-chnaif commented on Nov 10, 2026

    @aimane-chnaif
    Contributor

    samranahm proposes the same approach as annaweber830: detect the swipe with popstate.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.

  22. abbasifaizan70 commented on Nov 10, 2026

    @abbasifaizan70
    Contributor

    @aimane-chnaif Can you check my proposal #75905 (comment). Already added demo and test branch there. Thanks

  23. samranahm commented on Nov 10, 2026

    @samranahm
    Contributor

    @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 any node_modules patch or update to existing one.

  24. vance-engine commented on Nov 14, 2026

    @vance-engine

    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 popstate event, the application synchronizes its navigation state (as observed through root navigation listeners such as in src/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: none on 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.

  25. melvin-bot commented on Nov 14, 2026

    @melvin-bot

    📣 @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:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions