File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ const SegmentedControl = ({
36
36
fontStyle,
37
37
activeFontStyle,
38
38
appearance,
39
+ accessibilityHintSeperator = 'out of' ,
39
40
} : SegmentedControlProps ) : React . Node => {
40
41
const colorSchemeHook = useColorScheme ( ) ;
41
42
const colorScheme = appearance || colorSchemeHook ;
@@ -99,6 +100,7 @@ const SegmentedControl = ({
99
100
< SegmentedControlTab
100
101
enabled = { enabled }
101
102
selected = { selectedIndex === index }
103
+ accessibilityHint = { `${ index + 1 } ${ accessibilityHintSeperator } ${ values . length } ` }
102
104
key = { index }
103
105
value = { value }
104
106
tintColor = { tintColor }
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ type Props = $ReadOnly<{|
27
27
activeFontStyle ?: FontStyle ,
28
28
tabStyle ?: ViewStyle ,
29
29
appearance ?: 'dark' | 'light' | null ,
30
+ accessibilityHint ?: string ,
30
31
| } > ;
31
32
32
33
function isBase64 ( str ) {
@@ -45,6 +46,7 @@ export const SegmentedControlTab = ({
45
46
activeFontStyle = { } ,
46
47
appearance,
47
48
tabStyle,
49
+ accessibilityHint,
48
50
} : Props ) : React . Node => {
49
51
const colorSchemeHook = useColorScheme ( ) ;
50
52
const colorScheme = appearance || colorSchemeHook ;
@@ -88,6 +90,8 @@ export const SegmentedControlTab = ({
88
90
style = { [ styles . container , tabStyle ] }
89
91
disabled = { ! enabled }
90
92
onPress = { onSelect }
93
+ accessibilityHint = { accessibilityHint }
94
+ accessibilityRole = "button"
91
95
accessibilityState = { { selected : selected , disabled : ! enabled } } >
92
96
< View style = { styles . default } >
93
97
{ typeof value === 'number' || typeof value === 'object' ? (
You can’t perform that action at this time.
0 commit comments