Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent behaviour of fetcher.Form submission #10376

Open
dhruvkaushik305 opened this issue Dec 29, 2024 · 0 comments
Open

Inconsistent behaviour of fetcher.Form submission #10376

dhruvkaushik305 opened this issue Dec 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dhruvkaushik305
Copy link

I'm using React Router as a...

framework

Reproduction

this is the minimal environment https://stackblitz.com/edit/remix-run-remix-vu4mi2nx?file=app%2Froutes%2F_index.tsx

System Info

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
    Memory: 11.94 GB / 19.20 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node
    npm: 10.9.0 - ~/.nvm/versions/node/v22.12.0/bin/npm
    pnpm: 9.14.4 - ~/.nvm/versions/node/v22.12.0/bin/pnpm
    bun: 1.1.38 - ~/.bun/bin/bun
  Browsers:
    Brave Browser: 131.1.73.104
  npmPackages:
    @react-router/dev: ^7.0.2 => 7.0.2 
    @react-router/express: ^7.0.2 => 7.0.2 
    @react-router/fs-routes: ^7.0.2 => 7.0.2 
    @react-router/node: ^7.0.2 => 7.0.2 
    react-router: ^7.0.2 => 7.0.2 
    vite: ^5.4.11 => 5.4.11

Used Package Manager

npm

Expected Behavior

the expected behaviour is that the formData contains 3 fields: intent, otherIntent and name

Actual Behavior

commenting the prevent default completely ignores the additional formData appended and uncommenting it ignores the intent value of the button. other than creating a hidden input element with otherInten, what are the other ways of appending data into the existing formData via that handler

@dhruvkaushik305 dhruvkaushik305 added the bug Something isn't working label Dec 29, 2024
@timdorr timdorr transferred this issue from remix-run/react-router Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant