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 = ({
3636 fontStyle,
3737 activeFontStyle,
3838 appearance,
39+ accessibilityHintSeperator = 'out of' ,
3940} : SegmentedControlProps ) : React . Node => {
4041 const colorSchemeHook = useColorScheme ( ) ;
4142 const colorScheme = appearance || colorSchemeHook ;
@@ -99,6 +100,7 @@ const SegmentedControl = ({
99100 < SegmentedControlTab
100101 enabled = { enabled }
101102 selected = { selectedIndex === index }
103+ accessibilityHint = { `${ index + 1 } ${ accessibilityHintSeperator } ${ values . length } ` }
102104 key = { index }
103105 value = { value }
104106 tintColor = { tintColor }
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ type Props = $ReadOnly<{|
2727 activeFontStyle ?: FontStyle ,
2828 tabStyle ?: ViewStyle ,
2929 appearance ?: 'dark' | 'light' | null ,
30+ accessibilityHint ?: string ,
3031| } > ;
3132
3233function isBase64 ( str ) {
@@ -45,6 +46,7 @@ export const SegmentedControlTab = ({
4546 activeFontStyle = { } ,
4647 appearance,
4748 tabStyle,
49+ accessibilityHint,
4850} : Props ) : React . Node => {
4951 const colorSchemeHook = useColorScheme ( ) ;
5052 const colorScheme = appearance || colorSchemeHook ;
@@ -88,6 +90,8 @@ export const SegmentedControlTab = ({
8890 style = { [ styles . container , tabStyle ] }
8991 disabled = { ! enabled }
9092 onPress = { onSelect }
93+ accessibilityHint = { accessibilityHint }
94+ accessibilityRole = "button"
9195 accessibilityState = { { selected : selected , disabled : ! enabled } } >
9296 < View style = { styles . default } >
9397 { typeof value === 'number' || typeof value === 'object' ? (
You can’t perform that action at this time.
0 commit comments