Skip to content

External action redirect -> back button -> incorrect navigation.state #14762

@aaronadamsCA

Description

@aaronadamsCA

Reproduction

https://stackblitz.com/edit/github-nucwwnaj?file=app%2Froutes%2Fhome.tsx

  1. Submit a form whose action redirects to a third party (e.g. Shopify checkout).
  2. Press the back button to return to the page with the form.

System Info

System:
    OS: Linux 6.8 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
    CPU: (4) x64 AMD EPYC 7763 64-Core Processor
    Memory: 10.39 GB / 15.62 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.13.0 - /home/ubuntu/.volta/tools/image/node/24.13.0/bin/node
    Yarn: 4.12.0 - /home/ubuntu/.volta/tools/image/yarn/4.12.0/bin/yarn
    npm: 11.6.2 - /home/ubuntu/.volta/tools/image/node/24.13.0/bin/npm
    pnpm: 10.28.2 - /home/ubuntu/.volta/tools/image/pnpm/10.28.2/bin/pnpm
  npmPackages:
    @react-router/cloudflare: catalog: => 7.12.0 
    @react-router/dev: catalog: => 7.12.0 
    react-router: catalog: => 7.12.0 
    vite: catalog: => 8.0.0-beta.8

Used Package Manager

pnpm

Expected Behavior

navigation.state === "idle"

Actual Behavior

navigation.state === "submitting"

As a result, if you disable a "buy now" or "start checkout" button based on navigation.state to guard against submitting twice, then if the user returns to the page with the back button, the button stays disabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions