-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(material/radio): required attribute being set on buttons #30434
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for the contribution!
92c7a6b
to
99d1dfd
Compare
fixes when `MatRadioGroup` is set to be required it was setting all of its `MatRadioButton` to be required as-well which is confusing for assistive technologies, this commit ensures we only set aria-required on group rather than all buttons unless button is being used standalone of `MatRadioGroup` fixes angular#30399
// we never want to set required attribute on input when we have MatRadioGroup as we will set | ||
// aria-required directly on MatRadioGroup if its required as setting on all MatRadioButton for | ||
// it's MatRadioGroup would be confusing for assistive technology. | ||
if (this.radioGroup) return null; |
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.
made it that if used with group we don't set required attribute on inputs, this might be breaking for people who explicitly set required on radios.
Hi! Is there any update for this PR? |
ello @clamli! I think the PR has the necessary changes to fix the issue & its pending a review. however if you feel like anything is missing from it feel free to ping me. |
fixes when
MatRadioGroup
is set to be required it was setting all of itsMatRadioButton
to be required as-well which is confusing for assistive technologies, this commit ensures we only set aria-required on group rather than all buttons unless button is being used standalone ofMatRadioGroup
fixes #30399