File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -213,12 +213,21 @@ const SegmentedControl: React.FC<SegmentedControlProps> = ({
213213 tabTranslateAnimatedStyles ,
214214 ] }
215215 />
216- { segments . map ( ( segment , index ) => {
216+ { memoizedSegments . map ( ( segment , index ) => {
217+ const isSelected = currentIndex === index ;
218+ const { label, ...accessibilityProps } = segment ;
219+
217220 return (
218221 < Pressable
219222 onPress = { ( ) => memoizedTabPressCallback ( index ) }
220223 key = { index }
221224 style = { [ styles . touchableContainer , pressableWrapper ] }
225+ accessibilityState = { { selected : isSelected } }
226+ accessibilityHint = { ! isSelected ? `Selects ${ label } option` : '' }
227+ accessibilityLabel = { `${ label } , option, ${ index + 1 } of ${
228+ segments . length
229+ } `}
230+ accessibilityRole = "button"
222231 >
223232 < View style = { styles . textWrapper } >
224233 < Text
@@ -228,7 +237,7 @@ const SegmentedControl: React.FC<SegmentedControlProps> = ({
228237 : finalisedInActiveTextStyle ,
229238 ] }
230239 >
231- { segment }
240+ { label }
232241 </ Text >
233242 { badgeValues [ index ] && (
234243 < View
You can’t perform that action at this time.
0 commit comments