Skip to content

fix: Add aria-hidden to interior radio button in RadioButtonItem#4882

Open
meatnordrink wants to merge 1 commit intocallstack:mainfrom
meatnordrink:patch-16
Open

fix: Add aria-hidden to interior radio button in RadioButtonItem#4882
meatnordrink wants to merge 1 commit intocallstack:mainfrom
meatnordrink:patch-16

Conversation

@meatnordrink
Copy link
Contributor

Motivation

tl;dr - RadioButton.Item re-presents the interior RadioButton when using Android TalkBack.

Android Talkback is Android's screen-reader, and it behaves somewhat differently than iOS's VoiceOver (which is more commonly used for screen-reader auditing). Talkback allows access to buttons-within-buttons (iOS does not), which can be a confusing experience for Talkback users if both the outer and inner buttons on an element present themselves as distinct elements, when in fact it's just a button with an onPress on an outer container as well as the inner button.

In the case of Radiobutton.Item, which groups a radio button and a label, Talkback first presents the user with the pressable radio button + label, as intended. However, it then presents just the radio button, which is within the RadioButton.Item, as a separate element. This is confusing, and is never the intended behavior.

This PR adds aria-hidden, which Talkback recognizes, to the inner RadioButton in RadioButtonItem, ensuring that Talkback does not read out the interior radio button as a separate element. It is still read out as part of the radio button + label group, as intended.

This change has no effect on iOS, as iOS does not reveal child pressables to VoiceOver (precisely for this reason).

It has no effect on the non screen-reader experience on any platform.

Related issue

#4881

Test plan

Attempt to navigate a RadioButton.Item with Android Talkback, iOS VoiceOver, and no screen reader. (I completed these tests locally.)

@callstack-bot
Copy link

Hey @meatnordrink, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@meatnordrink
Copy link
Contributor Author

meatnordrink commented Mar 23, 2026

The build failure is simply a snapshot test that needs to be updated. Running the tests locally required making changes to package.json to resolve npm dependency errors, an expansion of scope I didn't want to add to this PR, so I did not run them myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants