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

Programmatically setting fields to valid values still shows validation error. #13

Open
samsch opened this issue Mar 29, 2019 · 1 comment

Comments

@samsch
Copy link

samsch commented Mar 29, 2019

bug report

What is the current behavior?

Programmatically set html5 validated fields don't get set to valid.

What is the expected behavior?

Valid programmatically set values should be validated as valid.

Sandbox Link

https://codesandbox.io/s/m4woxw1xv8

First attempt to submit, which gives a validation error.
Hit "Programmatically set name field" (notice in FF the field is outline in red).
Hit Submit again, and notice the field still gives a validation error.

To make the field vaild, you must directly edit the field.

This also seems to apply to browser autofilled fields, but maybe only some of the time? (I'm not sure I can reproduce this consistently.)

What's your environment?

Latest (2019-03-29) FF, RFF, RFF HTML5 Validation, React, ReactDOM.
Tested in Firefox 66.0.1 and Chrome 73.0.3683.86 (64-bit) on Xubuntu 18.04.

@TylerRick
Copy link
Contributor

Oh dear, so this bug has been around since March?

I just ran into this as well and was about to submit a new issue when I saw this existing issue.

Here is my reproduction, which is using the latest versions of everything (react-final-form 6.3.0): https://codesandbox.io/s/react-final-form-html5-validation-13-y1uqs

(Looks like this doesn't manifest itself when using "plain" Field from react-final-form: https://codesandbox.io/s/react-final-form-html5-validation-13-p80id)

Are there any good workarounds?

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