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
We’re working with Primer Brand form components and think we’ve found an accessibility issue with the FormControl.Validation component. We’re trying to connect the TextInput with the corresponding FormControl.Validation component using aria-describedby and id attributes on both components. The issue is that FormControl.Validation seems to ignore the id attribute we pass as a prop, so we’re unable to link the two components together (even though the documentation states it’s a valid prop for this component).
<FormControlfullWidthrequired><FormControl.Label>Your email</FormControl.Label><TextInputaria-describedby="email-validation-msg"type="email"/><FormControl.Validationid="email-validation-msg">{/* <- this id gets ignored */}{error}</FormControl.Validation></FormControl>
Additionally, I wonder if this is something FormControl could handle by default, so we wouldn’t need to manually connect both components, and Primer Brand could provide an accessible experience out of the box 🤔
Please forgive me if there are other ways to achieve this same accessibility that I’m not aware of but are already supported in Primer Brand!
Describe the bug
Hey folks,
We’re working with Primer Brand form components and think we’ve found an accessibility issue with the
FormControl.Validation
component. We’re trying to connect theTextInput
with the correspondingFormControl.Validation
component usingaria-describedby
andid
attributes on both components. The issue is thatFormControl.Validation
seems to ignore theid
attribute we pass as a prop, so we’re unable to link the two components together (even though the documentation states it’s a valid prop for this component).Additionally, I wonder if this is something
FormControl
could handle by default, so we wouldn’t need to manually connect both components, and Primer Brand could provide an accessible experience out of the box 🤔Please forgive me if there are other ways to achieve this same accessibility that I’m not aware of but are already supported in Primer Brand!
Reproduction steps
https://codepen.io/sergioalvz/pen/poMarxY
Expected behavior
The FormControl.Validation component does forward the id prop to the actual DOM element.
Screenshots
No response
Browsers
No response
OS
No response
The text was updated successfully, but these errors were encountered: