-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: remove duplicate tabstop in RadioButton.Item #5050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -165,7 +165,16 @@ const RadioButtonItem = ({ | |||||||||
| color, | ||||||||||
| theme, | ||||||||||
| uncheckedColor, | ||||||||||
| }; | ||||||||||
| // The outer TouchableRipple in RadioButtonItem already provides the | ||||||||||
| // interactive surface. Hide the inner RadioButton from the | ||||||||||
| // accessibility tree so screen readers only encounter one control, | ||||||||||
| // and keep tabIndex: -1 so web keyboard users have a single | ||||||||||
| // tabstop per row (matches the approach used in Checkbox.Item). | ||||||||||
| focusable: false, | ||||||||||
| tabIndex: -1, | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could we also hide inner
so could we explicitly hide inner visual control as documented for aria-hidden?
Suggested change
this follows the same approach already used by Checkbox.Item |
||||||||||
| accessible: false, | ||||||||||
| 'aria-hidden': true, | ||||||||||
| } as const; | ||||||||||
| const isLeading = position === 'leading'; | ||||||||||
| let radioButton: any; | ||||||||||
|
|
||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about updating the snapshots & adding regression test here?
existing
RadioButton.Itemtests usetoMatchSnapshot()& those snapshots currently containfocusable={true}for inner radio.since this PR changes that rendered output but only updates the component file, the snapshot tests will fail when CI runs, I suppose
it would also be useful to guard against the duplicate control explicitly: