Skip to content

Commit 52f3b75

Browse files
authored
set accessibilityValue to Switch component and update accessibilityStates (#791)
1 parent 5a8e90d commit 52f3b75

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/switch/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ class Switch extends BaseComponent {
8686
return {
8787
accessible: true,
8888
accessibilityRole: 'switch',
89-
accessibilityStates: disabled ? ['disabled'] : value ? ['checked'] : ['unchecked']
89+
accessibilityStates: {disabled, checked: value},
90+
accessibilityValue: {text: value ? '1' : '0'}
9091
};
9192
}
9293

0 commit comments

Comments
 (0)