Skip to content

Editorial: note to expand radiogroup content 'allowances'#2159

Merged
pkra merged 5 commits intomainfrom
radiogroup-note
Feb 26, 2026
Merged

Editorial: note to expand radiogroup content 'allowances'#2159
pkra merged 5 commits intomainfrom
radiogroup-note

Conversation

@scottaohara
Copy link
Copy Markdown
Member

@scottaohara scottaohara commented Apr 15, 2024

🚀 Netlify Preview:
🔄 this PR updates the following sspecs:

This PR attempts to close #1721

Per the discussion we had around the issue, the potential usability and wcag issues this could cause, there were few pros to relaxing how one could create a grouping of radio buttons. The issue of how would one name such a group if there is no actual "group" container to name was a very good point. Though HTML allows for such loose grouping of their radio buttons, they do not have a solution for all the potential a11y problems it can solve.

So, this PR takes a different approach to resolving the issue, and instead adds a note to clarify that a radiogroup does not have to be limited to just radio buttons, while ALSO pointing out the potential UX issues of adding other arbitrary/focusable elements.

Maybe something could even be added to overtly state that "hey if you want to group radio buttons like you can in HTML, then use HTML radio buttons!"

Happy to wordsmith this further (examples might be good?) Or entertain other solutions (we could close the issue as won't fix, but i recall being told we should do something rather than just that).

I created #2158 as a separate issue to resolve, since a lot of the conversation about this concept touched on the topic now logged in that issue. and I didn't want resolving this issue/pr to lose that separate though related topic.


Preview | Diff

index.html Outdated
that are enabled only when a specific radio button has been chosen (checked).</p>
<p>However, including non-radio button content into a <code>radiogroup</code> is not without its potential UX drawbacks. As it is generally expected
to use arrow keys to navigate between radio buttons, any non-radio button content could go unnoticed by some users, as arrowing through the radio buttons
would mean that any other tabbable elements (e.g., hyperlinks or other form fields) would be skipped. When creating a <code>radiogroup</code> with other
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it is generally expected to use arrow keys to navigate between radio buttons, any non-radio button content could go unnoticed by some users, as arrowing through the radio buttons would mean that any other tabbable elements (e.g., hyperlinks or other form fields) would be skipped.

A couple questions/comments:

  • If interactive, non-radio button content (e.g., an additional field that appears on radio button selection) is also nested within the radiogroup, would this require extra work to keep track of focus? It sounds like this results in additional complexity for keyboard operability, i.e., when a radio button is focused, focus should move to the next tabbable element inside the radiogroup (if present) and not the next focusable element immediately after the radio group content
  • For additional non-radio content that appears on focus of a radio button, it sounds like this is OK provided the content appears after the current point of focus?
  • I'm also curious if this could break cardinality and AT reporting of how many items are in the radiogroup. Perhaps ATs can compensate for additional non-radio button content by adding the extra non-radio button stuff to ensure accurate setsize/posinset? I agree this should be discouraged for the reasons you've mentioned (and that it would be jarring for AT users to get kicked out of forms/focus mode when navigating non-interactive, non-radio button content)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quickly, but we can discuss more when we talk about this issue w/the group

  • for better/worse, i wouldn't expect any 'extra' keyboard focus work than what authors are doing now / how this would work if people used native HTML elements instead.
  • i think there could be additional author guidance for this pattern. apg might be better suited for that.
  • it shouldn't break anything? as far as i'm aware, radiogroups only provide setsize/posinset based on the radio buttons within, and don't include other items into the total count. If anything is doing otherwise, imo, that's a bug.

i made a quick demo in place of typing out many other words to describe current/expected behaviors.

@cookiecrook cookiecrook self-requested a review April 18, 2024 17:26
@spectranaut spectranaut requested a review from smhigley April 18, 2024 17:29
@pkra pkra added the spec:aria label Jun 14, 2024
@pkra pkra added the editorial a change to an example, note, spelling, grammar, or is related to publishing or the repo label Feb 9, 2025
@pkra pkra force-pushed the radiogroup-note branch from 5e49ded to 308b71b Compare March 13, 2025 11:55
@pkra
Copy link
Copy Markdown
Member

pkra commented Mar 13, 2025

Rebased on main

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2025

Deploy Preview for wai-aria ready!

Name Link
🔨 Latest commit 3d50866
🔍 Latest deploy log https://app.netlify.com/projects/wai-aria/deploys/69a0927a51001b0008dd87db
😎 Deploy Preview https://deploy-preview-2159--wai-aria.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

scottaohara and others added 3 commits September 2, 2025 17:55
This PR attempts to close #1721

Per the discussion we had around the issue, the potential usability and wcag issues this could cause, there were few pros to relaxing how one could create a grouping of radio buttons.  The issue of how would one name such a group if there is no actual "group" container to name was a very good point.  Though HTML allows for such loose grouping of their radio buttons, they do not have a solution for all the potential a11y problems it can solve.

So, this PR takes a different approach to resolving the issue, and instead adds a note to clarify that a radiogroup does not have to be limited to just radio buttons, while ALSO pointing out the potential UX issues of adding other arbitrary/focusable elements.

Maybe something could even be added to overtly state that "hey if you want to group radio buttons like you can in HTML, then use HTML radio buttons!"

Happy to wordsmith this further (examples might be good?)  Or entertain other solutions (we could close the issue as won't fix, but i recall being told we should do _something_ rather than just that).

I created #2158 as a separate issue to resolve, since a lot of the conversation about this concept touched on the topic now logged in that issue.  and I didn't want resolving this issue/pr to lose that separate though related topic.
@daniel-montalvo
Copy link
Copy Markdown
Contributor

Conflicts resolved!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 26, 2026

🚀 Deployed on https://deploy-preview-2159--wai-aria.netlify.app

@github-actions github-actions bot temporarily deployed to pull request February 26, 2026 15:01 Inactive
Co-authored-by: Peter Krautzberger <p.krautzberger@gmail.com>
@github-actions github-actions bot temporarily deployed to pull request February 26, 2026 18:38 Inactive
@pkra pkra merged commit 9ec520e into main Feb 26, 2026
9 checks passed
@github-project-automation github-project-automation bot moved this from Needs Review to Reviewed, need PR checklist item in ARIA Editorial (Spec Prose Updates) PR Tracking Feb 26, 2026
@pkra pkra deleted the radiogroup-note branch February 26, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editorial a change to an example, note, spelling, grammar, or is related to publishing or the repo spec:aria

Projects

Status: Reviewed, need PR checklist item

Development

Successfully merging this pull request may close these issues.

Consider a mechanism to associate controls without an explicit grouping

7 participants