Closed meoyawn closed 1 year ago
Hi!
This is happening because you're disabling the input when isSubmitting === true
. A disabled input is never included in the FormData
. To fix, you could use readOnly
instead of disabled
.
That said, this will likely be fixed when I implement a fix for #117.
Hey, no rush, I replaced remix-validated-form
with react-hook-form
and thanks! TIL that Tailwind also has a read-only:
variant https://tailwindcss.com/docs/hover-focus-and-other-states#read-only
Which packages are impacted?
remix-validated-form
@remix-validated-form/with-zod
@remix-validated-form/with-yup
zod-form-data
What version of these packages are you using?
Please provide a link to a minimal reproduction of the issue.
https://github.com/meoyawn/remix-validated-form-use-is-submitting
Steps to Reproduce the Bug or Issue
Expected behavior
Submitting should render "Success". If you replace
useIsSubmitting()
call withfalse
, you'll see itScreenshots or Videos
You can see that
formData
is not passed to the server:Platform
Additional context
useIsSubmitting()
triggers React render, which replaces the form or something. Old<input />
gets removed from the DOM, makingnew FormData(form)
lose all the fields that get rerendered byuseIsSubmitting()
.Sorry I couldn't get Remix to work with Codesandbox