fix: Add aria-hidden to interior radio button in RadioButtonItem#4882
Open
meatnordrink wants to merge 1 commit intocallstack:mainfrom
Open
fix: Add aria-hidden to interior radio button in RadioButtonItem#4882meatnordrink wants to merge 1 commit intocallstack:mainfrom
meatnordrink wants to merge 1 commit intocallstack:mainfrom
Conversation
|
Hey @meatnordrink, thank you for your pull request 🤗. The documentation from this branch can be viewed here. |
Contributor
Author
|
The build failure is simply a snapshot test that needs to be updated. Running the tests locally required making changes to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
tl;dr -
RadioButton.Itemre-presents the interiorRadioButtonwhen 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
onPresson 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 theRadioButton.Item, as a separate element. This is confusing, and is never the intended behavior.This PR adds
aria-hidden, which Talkback recognizes, to the innerRadioButtoninRadioButtonItem, 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.Itemwith Android Talkback, iOS VoiceOver, and no screen reader. (I completed these tests locally.)