-
Notifications
You must be signed in to change notification settings - Fork 600
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(foundation): remove readonly from radio button #6438
Conversation
readonly on radio button violates a WCAG rule. see microsoft#6437 there's no evidence readonly applies on radio button. it does on radio group however - [aria-readonly associated roles on MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-readonly#associated_roles) doesn’t list radio - https://stackoverflow.com/questions/1953017/why-cant-radio-buttons-be-readonly - https://www.w3schools.com/jsref/dom_obj_radio.asp
closes #6437 |
change/@microsoft-fast-foundation-b9885563-e3e8-4c85-a55d-bac04c627fec.json
Outdated
Show resolved
Hide resolved
change/@microsoft-fast-foundation-b9885563-e3e8-4c85-a55d-bac04c627fec.json
Outdated
Show resolved
Hide resolved
…4c627fec.json Co-authored-by: Nicholas Rice <[email protected]>
…4c627fec.json Co-authored-by: Nicholas Rice <[email protected]>
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 putting this together! I think there is still a little more that needs to be done here. Previously, the radio itself would prevent changing its checked value when readonly. That behavior essentially needs to be moved instead of removed; the checkbox radio shouldn't get checked when that radiogroup is readonly.
you mean radio shouldn't get checked? |
Yes, sorry - radio |
I ran the site locally on this branch and it seems to already be covered. correct me if I'm missing anything here @nicholasrice but this is the expected behavior when radio group is set to Screen.Recording.2022-10-11.at.10.17.53.mov |
Odd, yes that is my expectation. When I set |
I just tried again - setting the |
you're right. now covered click, keypress and arrow navigation and tabbing into group. took the liberty to refactor a const to class getter as it repeated in more than 2 places. |
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 good, with one suggestion. Thanks for making this update!
Co-authored-by: Nicholas Rice <[email protected]>
Can this be merged? |
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.
Since we removed the tests for the radio itself...do we have an equivalent test for the group?
radio-group had already featured its own anything you think should be added considering this change? |
Do we have a test or some other way to ensure that when setting the group to readonly that the individual radios will be readonly? Does the platform handle that for us? |
How about testing if setting I guess this should be hardened? in the scope of this PR? Screen.Recording.2022-10-26.at.22.03.25.mov |
@yinonov @olaf-k Given the refactor for "disabled" behavior in PR, etc and the new tests added, I'd like to rebase this and test once those changes are in and follow-up on the tests/behavior at that point. I think the changes made in #6601 will lend themself more towards ensuring that radios are treated as "readonly" from an interactive standpoint. My only other thought there is ensuring that they're communicated in the a11y tree as readonly...but that we can validate at the same time. Thoughts? |
@yinonov - with the radio/radio group refactor in to solve the state issue it looks like we have some conflicts here. I'd love to get this in. Do we want to resolve conflicts on this branch or just kick off a new one to remove readonly? Happy to move it through quickly regardless of the approach :) |
no sweat, resolved the conflicts |
Can this be merged? |
Thanks @chrisdholt. Merged |
* fix(foundation): remove readonly from radio button readonly on radio button violates a WCAG rule. see #6437 there's no evidence readonly applies on radio button. it does on radio group however - [aria-readonly associated roles on MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-readonly#associated_roles) doesn’t list radio - https://stackoverflow.com/questions/1953017/why-cant-radio-buttons-be-readonly - https://www.w3schools.com/jsref/dom_obj_radio.asp * remove any evidence of readonly from class * completely remove any readonly * Change files * group slotted radio readonly handling * docs update * Update change/@microsoft-fast-foundation-b9885563-e3e8-4c85-a55d-bac04c627fec.json Co-authored-by: Nicholas Rice <[email protected]> * Update change/@microsoft-fast-foundation-b9885563-e3e8-4c85-a55d-bac04c627fec.json Co-authored-by: Nicholas Rice <[email protected]> * prevent check of radio buttons * Update packages/web-components/fast-foundation/src/radio/radio.ts Co-authored-by: Nicholas Rice <[email protected]> * revert * remove unused * FASTRadioGroup to be used as type only * fixup prettier and API report --------- Co-authored-by: Nicholas Rice <[email protected]> Co-authored-by: Rob Eisenberg <[email protected]> Co-authored-by: Chris Holt <[email protected]>
readonly
attribute on a radio button violates a WCAG rule. see #6437there's no evidence
readonly
should be applied on a radio button. it does on radio group howeveras a matter of fact, native radio ignores
readonly
on interactionScreen.Recording.2022-10-09.at.9.22.14.mov