Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Issues with RHFInput and validation #28

Closed
piehouserat opened this issue Dec 10, 2019 · 1 comment
Closed

Issues with RHFInput and validation #28

piehouserat opened this issue Dec 10, 2019 · 1 comment
Labels
question Further information is requested

Comments

@piehouserat
Copy link

Describe the bug
When using a controlled component such as Material UI's radio group along with validation rules, validation errors are not cleared when the component is made valid

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/react-hook-form-rhfinput-vh5qc
  2. Click on the submit button straight away (notice the validation message on the form)
  3. Select one of the radio button options in order to fix the validation error
  4. Validation error message is still displayed until clicking the submit button again

Codesandbox link
https://codesandbox.io/s/react-hook-form-rhfinput-vh5qc

Expected behavior
Validation errors should disappear when the component is made valid using the default form mode of 'onChange'

@bluebill1049
Copy link
Member

you can add mode="onChange" to trigger validation onChange.

@bluebill1049 bluebill1049 added the question Further information is requested label Dec 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants