Commit 213b616 authored and committed Jul 20, 2023 Unverified
1 parent a8a0c17 commit 213b616 Copy full SHA for 213b616
File tree 2 files changed +3
-2
lines changed
packages/react-native-web/src/exports/Switch
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ function findSwitchThumb(container) {
23
23
24
24
describe ( 'components/Switch' , ( ) => {
25
25
test ( 'accessibilityLabel is applied to native checkbox' , ( ) => {
26
- const { container } = render ( < Switch accessibilityLabel = "switch" /> ) ;
26
+ const { container } = render ( < Switch aria-label = "switch" /> ) ;
27
27
expect ( findCheckbox ( container ) . getAttribute ( 'aria-label' ) ) . toBe ( 'switch' ) ;
28
28
} ) ;
29
29
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ const Switch: React.AbstractComponent<
44
44
React . ElementRef < typeof View >
45
45
> = React . forwardRef ( ( props , forwardedRef ) => {
46
46
const {
47
+ 'aria-label' : ariaLabel ,
47
48
accessibilityLabel,
48
49
activeThumbColor,
49
50
activeTrackColor,
@@ -166,7 +167,7 @@ const Switch: React.AbstractComponent<
166
167
] ;
167
168
168
169
const nativeControl = createElement ( 'input' , {
169
- accessibilityLabel,
170
+ 'aria-label' : ariaLabel || accessibilityLabel ,
170
171
checked : value ,
171
172
disabled : disabled ,
172
173
onBlur : handleFocusState ,
You can’t perform that action at this time.
0 commit comments