documentation icon indicating copy to clipboard operation
documentation copied to clipboard

issue: shouldUseNativeValidation without progressive doesn't work as expected

Open marcomuser opened this issue 10 months ago • 1 comments

Version Number

7.54.0

Codesandbox/Expo snack

https://codesandbox.io/p/sandbox/beautiful-stallman-738wjw

Steps to reproduce

  1. Go to https://codesandbox.io/p/sandbox/beautiful-stallman-738wjw
  2. Click on submit button
  3. Even though all fields are required, no browser validation is displayed
  4. Enable progressive: true in the useForm hook
  5. Resubmit the form
  6. See browser validation error!

Expected behaviour

This might not be a bug but a lack of documentation. I just followed the docs for the shouldUseNativeValidation property. The progressive property is not documented at all in the useForm docs. I found it in the release notes after digging a little bit into the source code. After enabling both properties it works exactly as expected!

What's the purpose of shouldUseNativeValidation without enabling progressive as well? Should they always be used together? Can we document and maybe even enforce that in the useForm config object via ts?

P.S. This is a fantastic feature! Absolutely love that react-hook-form enables this. ✨

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

marcomuser avatar Dec 08 '24 13:12 marcomuser