Skip to content

Fix error display for "nested" form data - #79

Merged
jadefish merged 6 commits into
mainfrom
b/fix-nested-errors
Feb 22, 2024
Merged

Fix error display for "nested" form data#79
jadefish merged 6 commits into
mainfrom
b/fix-nested-errors

Conversation

@jadefish

Copy link
Copy Markdown
Contributor

Handle nested field names in VErrors

This change fixes the web client's error handling to properly interpret and display errors for nested field names (e.g. address[ln1]) next to the form field itself.

Miscellaneous

  • chore: Run jest tests during CI builds

@jadefish
jadefish force-pushed the b/fix-nested-errors branch from caba216 to 9955df0 Compare February 12, 2024 15:07
This change fixes the web client's error handling to properly interpret
and display errors for nested field names (e.g. `address[ln1]`) next to
the form field itself.
An error group element allows users to provide a closer target for
errors that would otherwise be rendered at the top of the page.

If a validation error refers to a nested field (e.g. `address[ln1]`),
and an `data-error-group="address"` element is on the page, any messages
for address fields will instead be rendered within the error group
element.

This logic applies only to page-level error message display. If a form
field for an error message is accessible, an error group matching the
message (if present) is not used.
@jadefish
jadefish force-pushed the b/fix-nested-errors branch from 9955df0 to 37dce82 Compare February 12, 2024 17:46
@jadefish
jadefish marked this pull request as ready for review February 12, 2024 17:49
@jadefish
jadefish requested a review from a team February 12, 2024 17:49
@jadefish
jadefish force-pushed the b/fix-nested-errors branch from 37dce82 to 062c565 Compare February 22, 2024 16:58
@jadefish
jadefish merged commit af6eae7 into main Feb 22, 2024
@jadefish
jadefish deleted the b/fix-nested-errors branch February 22, 2024 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants