Required radio groups: screen readers aren't announcing the "required" state
🐛 Bug Report
Screen readers are not announcing when a required radio group is required for users.
To Reproduce
Steps to reproduce the behavior:
- Turn on VoiceOver, launch Safari (may also be reproduced in Chrome)
- Navigate to the Canvas Kit design site > Components > Inputs > Radio > Examples
- Set the rotor to "heading" : Ctrl + Opt + Cmd + ArrowRight
- Jump to the "Required" heading: Ctrl + Opt + Cmd + ArrowDown
- Read the Required radio group example: Ctrl + Opt + ArrowRight
- Issue: Observe VoiceOver does not indicated "required" at any time when reading the group, the legend, or the individual inputs.
- Use the Tab key to focus the radio group
- Use the Up / Down Arrow keys to select radio buttons
- Issue: Observe VoiceOver still is not announcing "required" state at any time
Expected Behavior
We want screen readers to announce "required" state to users when reading virtually, or when Tab focus enters the group.
Actual Results
Outlined in reproduction steps above, steps 6 and 9.
Browser (if applicable)
MacOS 12.6.8, Safari 16.6 and Chrome (current build)
Link to repl or repo (highly encouraged)
Design Site: https://canvas.workdaydesign.com/components/inputs/radio#tab=web&heading=required Storybook: https://workday.github.io/canvas-kit/?path=/story/preview-inputs-radio--required
Error Output
Observe HTML 'required' attribute applied to generic <div> element, and the misplaced aria-describedby and aria-checked attributes in screen shot below.
Include a screenshot of a visual bug
### Tasks
Recommendations:
- Apply the HTML
requiredattribute to the - Reduced test case: https://codepen.io/apoblete/pen/zYyvRJJ?editors=1010
- Remove invalud aria from generic elements (see attached screen cap)