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

Field continues to be required even after changing required prop to false #19

Open
TylerRick opened this issue Sep 19, 2019 · 2 comments

Comments

@TylerRick
Copy link
Contributor

Are you submitting a bug report or a feature request?

Bug report

What is the current behavior?

If required prop is initially true, then the validate function continues to require the field to be filled in, even if you later change the required prop to false.

What is the expected behavior?

As soon as required prop changes, validation checks should reflect that that. So if you change it to false, the field should no longer be required.

Sandbox Link

https://codesandbox.io/s/react-final-form-html5-validation-example-n2q8d

Other information

Likely related to #13

@TylerRick
Copy link
Contributor Author

TylerRick commented Sep 19, 2019

Note that the problem goes away if you change it to use the Field from 'react-final-form' instead.

@TylerRick
Copy link
Contributor Author

As a workaround, you can set key to the same thing as you set required prop to. But we shouldn't have to resort to this, should we??

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

1 participant