You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using SelectButton 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 field but cannot and throws an error.
Create a react hook form with at least one PrimeReact Password component (form can have other fields/inputs too).
Make sure the PrimeReact Password component has some kind of validation - for example, field is required.
Fill in all fields, except for the PrimeReact Password (or otherwise make this field invalid)
Submit the form to see e.focus / elm.focus error.
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 SelectButton 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:
melloware
added
Type: Bug
Issue contains a defect related to a specific component.
and removed
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
labels
Dec 16, 2022
Describe the bug
Same as: #3645
Forum Post: https://forum.primefaces.org/viewtopic.php?f=57&t=78159
When using SelectButton 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 field but cannot and throws an error.
Reproducer
https://codesandbox.io/s/still-framework-7vr7uj?file=/src/App.js
PrimeReact version
8.7.3
React version
17.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
ALL
Steps to reproduce the behavior
Create a react hook form with at least one PrimeReact Password component (form can have other fields/inputs too).
Make sure the PrimeReact Password component has some kind of validation - for example, field is required.
Fill in all fields, except for the PrimeReact Password (or otherwise make this field invalid)
Submit the form to see e.focus / elm.focus error.
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 SelectButton 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: