Skip to content

Fix isSubmitting state value when using encType application/json#170

Merged
AlemTuzlak merged 1 commit intocode-forge-io:mainfrom
CommerceBear:bugfix/fix-json-issubmitting
Jun 20, 2025
Merged

Fix isSubmitting state value when using encType application/json#170
AlemTuzlak merged 1 commit intocode-forge-io:mainfrom
CommerceBear:bugfix/fix-json-issubmitting

Conversation

@BobReid
Copy link
Copy Markdown
Contributor

@BobReid BobReid commented May 27, 2025

Description

This PR fixes a bug where the form isSubmitting state is not tracked properly when using encType: 'application/json'.
The issue is that the hook only considers navigation / fetcher formData when calculating that a submission is happening. formData is always undefined when using application/json and navigation / fetcher json is populated with the equivalent data.

Fixes #168

If this is a new feature please add a description of what was added and why below:

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Unit tests

Checklist:

  • My code follows the guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

…ubmission completes when using encType = application/json
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Jun 20, 2025

Open in StackBlitz

npm i https://pkg.pr.new/forge-42/remix-hook-form@170

commit: 1c0b498

@AlemTuzlak AlemTuzlak merged commit ed7cc92 into code-forge-io:main Jun 20, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isSubmitting never reverts to false when using encType 'application/json'

2 participants