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
Corrects the styles of the read-only state to show the radio inputs and allow visible focus. Also adds `aria-disabled` since `aria-readonly` isn't well supported, and story demonstrates scripting to make selection for read-only radios immutable.
Copy file name to clipboardExpand all lines: components/radio/stories/radio.stories.js
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -130,11 +130,14 @@ Disabled.parameters = {
130
130
};
131
131
132
132
/**
133
-
* A radio group has a read-only option for when it's in the disabled state but still needs to be shown.
134
-
* This allows for content to be copied, but not interacted with or changed.
133
+
* A radio group has a read-only option for when it's functionally disabled but still needs to be shown.
134
+
* This allows for label content to be copied, but prevents the input from being interacted with or changed.
135
135
*
136
-
* - Read-only radio buttons are disabled, but not all disabled radio buttons are read-only.
137
-
* - Read-only radio buttons do not have a focus ring, but the button should be focusable.
136
+
* Read-only radio buttons:
137
+
* - prevent interaction like disabled, but not all disabled radio buttons are read-only
138
+
* - are immutable, i.e. their checked state cannot be changed
139
+
* - are keyboard focusable and communicate state to assistive technology
140
+
* - use `aria-disabled` since the `readonly` attribute [is not valid](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly#overview) and `aria-readonly` is not currently announced by the majority of screen readers.
0 commit comments