-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Password: Submit with React Hook Form #3645
Comments
I will investigate this. |
I fixed your Code Sandbox: https://codesandbox.io/s/white-glade-i26wqu?file=/src/App.js:4459-4626 The issue is Password has an <Password
{...field}
inputRef={field.ref}
type="password"
placeholder="password input"
/> |
could you please update your example code using this fix on the react-form-hook example? it took me a while to figure it out: https://www.primefaces.org/primereact/reacthookform/ |
@hugomf I updated the showcase for the next major deployment with a Password React Hook Example. |
Describe the bug
When using Password component with React Hook Form, on submit, if the password is the only field to fail validation then React Hook Form attempts to put a focus on the password field but cannot and throws an error.
Standard input text and password fields work as expected, as does a password input wrapped in a div as generated by Prime React.
Reproducer
https://codesandbox.io/s/blissful-butterfly-pc6xhk
PrimeReact version
8.7.2
React version
18.x
Language
ES6
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
With all other fields types, standard html text or password, PrimeReact InputText then when submitting the form, if there are errors the first field with an error is focused on.
I would expect that, if the PrimeReact Password component is the first invalid field then the form should focus on this field too.
The text was updated successfully, but these errors were encountered: