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

issue: maxLength does not limit input field to length #1043

Open
1 task done
MylesWardell opened this issue Jan 18, 2024 · 1 comment
Open
1 task done

issue: maxLength does not limit input field to length #1043

MylesWardell opened this issue Jan 18, 2024 · 1 comment

Comments

@MylesWardell
Copy link

Version Number

7.49.3

Codesandbox/Expo snack

https://codesandbox.io/s/intelligent-poincare-f57gmx

Steps to reproduce

  1. Go to input
  2. See that maxLength is 3
  3. type and see that its allows more than 3

Expected behaviour

image
Text says max Length accepted by this input so I would assume its a passthrough to maxLength on the react input. If it was just validation it should say maxLength the input is validated or something like that.

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Moshyfawn
Copy link
Member

The prop does not appear to be documented, but you can enable the passing of native validation props to input elements by using the progressive: true flag on useForm.

If it was just validation it should say maxLength the input is validated or something like that.

Validation is only performed based on the mode prop, which defaults to onSubmit. This means that your expected validation error would occur on form submission. If you require validation to occur onChange, consider using mode: "onChange".

@bluebill1049 bluebill1049 transferred this issue from react-hook-form/react-hook-form Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants