Skip to content

Commit 7a19af7

Browse files
ankit-tailorfacebook-github-bot
authored andcommitted
fix: add mixed to aria-checked typings (#34633)
Summary: `aria-checked` prop should accept `mixed` as value as given [here](https://www.w3.org/WAI/GL/wiki/Using_WAI-ARIA_aria-checked%3Dmixed) and also [accessibilityState.checked](https://reactnative.dev/docs/accessibility#accessibilitystate) accepts mixed to represent checkboxes. This change refers to issue #34424 and PR #34524 ## Changelog [General] [Added] - Added `mixed` value for `aria-checked`. Pull Request resolved: #34633 Test Plan: ```js <TouchableOpacity accessibilityRole="checkbox" aria-checked="mixed" accessibilityHint="click me to change state"> <Text>Checkbox example</Text> </TouchableOpacity> ``` Reviewed By: lunaleaps Differential Revision: D39382158 Pulled By: necolas fbshipit-source-id: fa026274111305cc0bcbb42ed974ca1be7d779a5
1 parent fae770b commit 7a19af7

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

Libraries/Components/Button.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ type ButtonProps = $ReadOnly<{|
157157
* see https://reactnative.dev/docs/accessibility#accessibilitystate
158158
*/
159159
'aria-busy'?: ?boolean,
160-
'aria-checked'?: ?boolean,
160+
'aria-checked'?: ?boolean | 'mixed',
161161
'aria-disabled'?: ?boolean,
162162
'aria-expanded'?: ?boolean,
163163
'aria-selected'?: ?boolean,

Libraries/Components/Pressable/Pressable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type Props = $ReadOnly<{|
6565
* see https://reactnative.dev/docs/accessibility#accessibilitystate
6666
*/
6767
'aria-busy'?: ?boolean,
68-
'aria-checked'?: ?boolean,
68+
'aria-checked'?: ?boolean | 'mixed',
6969
'aria-disabled'?: ?boolean,
7070
'aria-expanded'?: ?boolean,
7171
'aria-selected'?: ?boolean,

Libraries/Components/Touchable/TouchableWithoutFeedback.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type Props = $ReadOnly<{|
5454
* see https://reactnative.dev/docs/accessibility#accessibilitystate
5555
*/
5656
'aria-busy'?: ?boolean,
57-
'aria-checked'?: ?boolean,
57+
'aria-checked'?: ?boolean | 'mixed',
5858
'aria-disabled'?: ?boolean,
5959
'aria-expanded'?: ?boolean,
6060
'aria-selected'?: ?boolean,

Libraries/Components/View/ViewAccessibility.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export interface AccessibilityProps
5353
* see https://reactnative.dev/docs/accessibility#accessibilitystate
5454
*/
5555
'aria-busy'?: boolean | undefined;
56-
'aria-checked'?: boolean | undefined;
56+
'aria-checked'?: boolean | 'mixed' | undefined;
5757
'aria-disabled'?: boolean | undefined;
5858
'aria-expanded'?: boolean | undefined;
5959
'aria-selected'?: boolean | undefined;

Libraries/Components/View/ViewPropTypes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ export type ViewProps = $ReadOnly<{|
531531
* see https://reactnative.dev/docs/accessibility#accessibilitystate
532532
*/
533533
'aria-busy'?: ?boolean,
534-
'aria-checked'?: ?boolean,
534+
'aria-checked'?: ?boolean | 'mixed',
535535
'aria-disabled'?: ?boolean,
536536
'aria-expanded'?: ?boolean,
537537
'aria-selected'?: ?boolean,

Libraries/Text/TextProps.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export type TextProps = $ReadOnly<{|
8686
* see https://reactnative.dev/docs/accessibility#accessibilitystate
8787
*/
8888
'aria-busy'?: ?boolean,
89-
'aria-checked'?: ?boolean,
89+
'aria-checked'?: ?boolean | 'mixed',
9090
'aria-disabled'?: ?boolean,
9191
'aria-expanded'?: ?boolean,
9292
'aria-selected'?: ?boolean,

0 commit comments

Comments
 (0)