All radio inputs inside of a required radio group have the required
attribute. Expected?
#6186
Replies: 3 comments 5 replies
-
Actually after re-reading the MDN docs carefully I've answered this entire question... it specifically says if any of the radio inputs have the required attribute, one must be selected but it doesn't need to be the one with the required attribute. 😅 |
Beta Was this translation helpful? Give feedback.
-
I'd actually like to re-open the discussion here to see if there's any actual value to putting the |
Beta Was this translation helpful? Give feedback.
-
This is actually a bit of a misconception. We do use native form validation handling, and we do it by default in RAC. There is also a prop which allows you to change between "native" and "aria" where we do handle everything ( So if you remove those If you wish to get rid of those native required, you can set Form's |
Beta Was this translation helpful? Give feedback.
-
We were somewhat surprised to learn that all radio inputs inside of a required radio group also have the required attribute. Here's an example from RadioGroup Validation in the docs:
The MDN docs on radios around the required attribute state:
So it seems like the required attribute should only be used in cases where you want to make one specific radio button required to be selected, vs. on all radio inputs inside of a required radio group. Seems we might only wantaria-required
on the group, and never on the child inputs?Actually after re-reading the MDN docs carefully I've answered this entire question... it specifically says if any of the radio inputs have the
required
attribute, one must be selected but it doesn't need to be the one with therequired
attribute. 😅Would love some input from accessibility experts on this one. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions