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

Hidden field value does not get submitted unless Field rendered #146

Open
bitofbreeze opened this issue Jan 14, 2023 · 1 comment
Open

Comments

@bitofbreeze
Copy link

bitofbreeze commented Jan 14, 2023

I was very confused why this was happening for a while based on the docs that show that declaring the hidden fields with values in the Form props is enough.

It turns out when you use a custom form, you must write an instance of Field for the hidden inputs too. You can see in my repro that submitting with line 60 commented gives no value in the action for "hidden", but uncommenting it does. I wonder if this is intended behavior, and if so, if the docs can be clarified.

I don't understand why we even declare the hidden field in the props if you still have to write the Field JSX for it.

@darlantc
Copy link

I agree with you, this is annoying specially because it is hard to catch the problem when those hidden fields holds required values to submit the form.
It would be nice to have the hidden fields automatically pushed to the render tree for custom forms.

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

No branches or pull requests

2 participants