airjp73/rvf

[Bug]: RVF fails to submit dom data when encType is json

nick-potts opened this issue · 2 comments

Which packages are impacted?

  • @rvf/react
  • @rvf/remix
  • @rvf/zod
  • @rvf/yup
  • zod-form-data

What version of these packages are you using?

6.0.0

Please provide a link to a minimal reproduction of the issue.

https://github.com/nick-potts/rvf-repro/blob/main/app/routes/_index.tsx

Steps to Reproduce the Bug or Issue

Enable/disable the encType field. You'll see in the console that its trying to submit FormData to the fetcher. This only happens with 'dom' values.

Expected behavior

Data should be encoded as json correctly

Screenshots or Videos

No response

Platform

MacOS, Firefox

Additional context

No response

Thanks for reporting this! It looks like we're not correctly checking for the json encType when the submitSource is set to dom. (code).

As a workaround until I'm able to fix, it should work correctly with submitSource: "state".

Yeah no worries, just reporting it for ya. Had a poke around the codebase but couldn't see anywhere obvious to fix.