Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue #2526 #2527

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/calendar/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
ViewStyle,
AccessibilityActionEvent,
ColorValue,
Insets
Insets,
AccessibilityRole
} from 'react-native';
import {formatNumbers, weekDayNames} from '../../dateutils';
import styleConstructor from './style';
Expand Down Expand Up @@ -68,6 +69,8 @@ export interface CalendarHeaderProps {
current?: string;
/** Left inset for the timeline calendar header, default is 72 */
timelineLeftInset?: number;
/** Accessibility role of the header component */
accessibilityRole?: AccessibilityRole;
}

const accessibilityActions = [
Expand Down Expand Up @@ -102,7 +105,8 @@ const CalendarHeader = forwardRef((props: CalendarHeaderProps, ref) => {
importantForAccessibility,
numberOfDays,
current = '',
timelineLeftInset
timelineLeftInset,
accessibilityRole
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where this prop is declared?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defined in the props. Did you mean that?

} = props;

const numberOfDaysCondition = useMemo(() => {
Expand Down Expand Up @@ -279,7 +283,7 @@ const CalendarHeader = forwardRef((props: CalendarHeaderProps, ref) => {
testID={testID}
style={propsStyle}
accessible
accessibilityRole={'adjustable'}
accessibilityRole={accessibilityRole ?? "adjustable"}
accessibilityActions={accessibilityActions}
onAccessibilityAction={onAccessibilityAction}
accessibilityElementsHidden={accessibilityElementsHidden} // iOS
Expand Down