inveniosoftware / inveniosoftware/react-invenio-forms
ArrayField - UX issue in validation error handling when only one Field has a validation error
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
I would like to ask what is the reason behind the `hasGroupErrors` method in `ArrayField`:
https://github.com/inveniosoftware/react-invenio-forms/blob/016b12b63b38dc25658c83f539f384519cead4e2/src/lib/forms/ArrayField.js#L27-L35
https://github.com/inveniosoftware/react-invenio-forms/blob/016b12b63b38dc25658c83f539f384519cead4e2/src/lib/forms/ArrayField.js#L88-L92
What I don't understand is why there is an error object `hasError` that gets propagated down to SUI's `Form.Field` component. The UX problem I'm encountering here is if there is only one error in any field of the `ArrayField`, the whole `ArrayField` turns red (since empty `error` object in `hasError` is truthy in SUI's `Form.Field` props), and not just the specific Field with an error I would expect to be highlighted as red/error-y.

I would expect this outcome:

Also, related to this empty `error` object, there's React warning in the console:

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.