-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FCT 1207-1224: unique id's for error and warning containers in all -Field
components
#2950
Conversation
🦋 Changeset detectedLatest commit: cdf8c77 The changes in this PR will be included in the next version bump. This PR includes changesets to release 98 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really better than the first approach! Thanks for working through the monoton changes on all components!
packages/components/fields/async-select-field/src/async-select-field.spec.js
Show resolved
Hide resolved
e70c1c4
to
d7c853d
Compare
d7c853d
to
9e5d8e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This nicely fixes the broken setup we have. I liked @misama-ct suggestion around using :invalid
. Maybe an investigation can be a followup if we can use it.
…r the passed id on the wrapper container isntead of on the container for each message so that all errors/warnings can be referred to by aria-errormessage using a single id, update all -Field components to build the id's for their error and warning containers based on their unique id, update tests
9e5d8e6
to
cdf8c77
Compare
Summary
Guarantees unique HTML ID's in
FieldErrors
andFieldWarnings
components. Guarantee unique ID's for error/warning field containers for each-Field
component. Is the fix for this bug reported in slack.Description
The
FieldErrors
andFieldWarnings
components are meant to display error and warning fields. If multiple errors/warnings are passed to the component in the errors/warnings object, the component is meant to display multiple fields. Previously, if props.id was passed to the component, it would be used as the id attribute for each fields. If multiple errors/warnings were passed, each field would have the same id.This PR updates the
FieldErrors
andFieldWarnings
component so that all fields have a parent wrapper on which theid
is set. This insures that theid
passed to the component is always unique and refers to all errors/warnings.Each
-Field
component is updated so that it builds theid
for theerrors
andwarnings
containers based on the uniqueid
used for the-Field
input. This insures that theid
specified in thearia-errormessage
attribute for each-Field
is unique. Tests added to each-Field
component to ensure the id generation works as expected.There are a lot of components changed, but changes for all
-Field
components are very similar and so should be fairly straightforward to review.