@@ -2,7 +2,8 @@ import findIndex from 'lodash/findIndex';
2
2
import PropTypes from 'prop-types' ;
3
3
import XDate from 'xdate' ;
4
4
import React , { forwardRef , useCallback , useEffect , useImperativeHandle , useMemo , useRef , useState } from 'react' ;
5
- import { FlatList , FlatListProps , View , ViewStyle } from 'react-native' ;
5
+ import { AccessibilityInfo , FlatList , FlatListProps , View , ViewStyle } from 'react-native' ;
6
+
6
7
import { extractCalendarProps , extractHeaderProps } from '../componentUpdater' ;
7
8
import { parseDate , toMarkingFormat , xdateToData } from '../interface' ;
8
9
import { page , sameDate , sameMonth } from '../dateutils' ;
@@ -100,7 +101,9 @@ const CalendarList = (props: CalendarListProps & ContextProp, ref: any) => {
100
101
contentContainerStyle,
101
102
onEndReachedThreshold,
102
103
onEndReached,
103
- onHeaderLayout
104
+ onHeaderLayout,
105
+ accessibilityElementsHidden,
106
+ importantForAccessibility
104
107
} = props ;
105
108
106
109
const calendarProps = extractCalendarProps ( props ) ;
@@ -164,6 +167,7 @@ const CalendarList = (props: CalendarListProps & ContextProp, ref: any) => {
164
167
const data = xdateToData ( currMont ) ;
165
168
onMonthChange ?.( data ) ;
166
169
onVisibleMonthsChange ?.( [ data ] ) ;
170
+ AccessibilityInfo . announceForAccessibility ( currMont . toString ( 'MMMM yyyy' ) ) ;
167
171
}
168
172
} , [ currentMonth ] ) ;
169
173
@@ -271,9 +275,9 @@ const CalendarList = (props: CalendarListProps & ContextProp, ref: any) => {
271
275
style = { staticHeaderStyle }
272
276
month = { currentMonth }
273
277
addMonth = { addMonth }
274
- accessibilityElementsHidden = { true } // iOS
275
- importantForAccessibility = { 'no-hide-descendants' } // Android
276
278
onHeaderLayout = { onHeaderLayoutToPass }
279
+ accessibilityElementsHidden = { accessibilityElementsHidden } // iOS
280
+ importantForAccessibility = { importantForAccessibility } // Android
277
281
/>
278
282
) ;
279
283
}
0 commit comments