Skip to content

feat(RadioButton): Add guidelines to avoid nesting elements

Austin Regnery requested to merge aregnery/radio-buttons-guidelines-nesting into main

What does this MR do?

Adds a guideline to the behavior section of radio buttons that discourages mixing interactive elements between radio buttons. Avoiding this pattern prevents an accessibility issue from reaching the product. Inspired by this blog post: https://www.magentaa11y.com/checklist-web/radio/

Radio mixed with interactive elements

Avoid this pattern when possible! Radio groups are not supposed to consist of nested interactive elements. Radio button focus order is not what you may expect.

  • By default, it is not expected behavior that each radio button can be tabbed to. This is how radio buttons naturally behave
  • As soon as a radio button is selected, the selected radio input receives focus first from the group. As a result screen reader users may not discover a nested control for an option if they start switching between radio buttons alone

Does this MR meet the acceptance criteria?

Links

Edited by Austin Regnery

Merge request reports