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
{{ message }}
Repository navigation
onChange and onBlur validation errors should prevent submission of form #490
When the user submits the form, it does not show a form error on submit. This causes headaches currently as it makes things harder to workflow properly.
Hey @crutchcorn
The root cause of this error is because we have defined undefined for the submit cause that leads to validateSync returning early and not executing any onBlur/onChange validation.
One solution that comes to my mind is in case of submit cause, we can execute either onChange or onBlur validation(whichever is defined in the field) but this would lead to incorrect errorMap detail in the state as the errorMapKey would be submit and the error would correspond to onChange/onBlur.
Do you have any alternate suggestion to fix this ?
Activity
vikaskumar89 commentedon Oct 31, 2023
Hey @crutchcorn
Can you assign this to me please
MiirzaBaig commentedon Nov 4, 2023
Can you aasign this issue to me?
vikaskumar89 commentedon Nov 4, 2023
hey @I-MirzaBaig
I am working on this. Could you pick any other open issue.
MiirzaBaig commentedon Nov 4, 2023
@vikaskumar89 Alright!
vikaskumar89 commentedon Nov 4, 2023
Hey @crutchcorn
The root cause of this error is because we have defined
undefinedfor thesubmitcause that leads to validateSync returning early and not executing anyonBlur/onChangevalidation.error rootcause:
form/packages/form-core/src/FieldApi.ts
Line 337 in fd19453
One solution that comes to my mind is in case of
submitcause, we can execute eitheronChangeoronBlurvalidation(whichever is defined in the field) but this would lead to incorrect errorMap detail in the state as the errorMapKey would besubmitand the error would correspond toonChange/onBlur.Do you have any alternate suggestion to fix this ?
vikaskumar89 commentedon Nov 4, 2023
Due to this errorMap array, we are facing this issue in #486, as the errorMap is not clear after a valid value is entered.
danteissaias commentedon Nov 7, 2023
Is there currently a workaround to this?
vikaskumar89 commentedon Nov 7, 2023
@danteissaias yeah fix should be out in a couple of days.
crutchcorn commentedon Dec 3, 2023
This fix is released in
0.10.0!