Repository navigation
Closed
Milestone
Description
This validation is a little aggro.
You shouldn't get screamed at if all you do is blur the field (e.g., to look at the rest of the form if the form is longer). My first thought is that we can simply not validate on blur until the field (or the form?) is empty. I kind of doubt we can implement this on the form itself using mode because the options are pretty flat — submit, blur, change, touched, all. However, it would be pretty do at the display layer: regardless of whether there is an error on the field, only show it under certain conditions, which we can pull from the field and form state.
console/app/components/form/fields/TextField.tsx
Lines 83 to 100 in d41e40f
| render={({ field, fieldState: { error } }) => { | |
| return ( | |
| <> | |
| <UITextField | |
| title={label} | |
| type={type} | |
| error={!!error} | |
| aria-labelledby={cn(`${id}-label`, { | |
| [`${id}-help-text`]: !!description, | |
| })} | |
| aria-describedby={description ? `${id}-label-tip` : undefined} | |
| {...field} | |
| {...props} | |
| /> | |
| <ErrorMessage error={error} label={label} /> | |
| </> | |
| ) | |
| }} |
Metadata
Metadata
Assignees
Labels
No labels

Activity
david-crespo commentedon Feb 8, 2023
To me this is pretty annoying in all the core flows in the app, but it's not broken per se, so I'm putting it at the top of MVP+1 for now.
david-crespo commentedon Oct 4, 2023
I'm not sure there's a nice way to fix this, so it might be prudent to decide we can live with it. I don't really like my display-level hiding idea — I think it's a recipe for pain to have validation errors that aren't displayed.