Skip to content

Commit

Permalink
Merge branch 'main' into add-close-accessibility-tap-area
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Feb 12, 2023
2 parents 63229a7 + 99ff9f7 commit e7cbdf7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/drawer/src/views/DrawerItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ type Props = {
* Whether label font should scale to respect Text Size accessibility settings.
*/
allowFontScaling?: boolean;

/**
* Accessibility label for drawer item.
*/
accessibilityLabel?: string;
/**
* ID to locate this drawer item in tests.
*/
testID?: string;
};

const LinkPressable = ({
Expand Down Expand Up @@ -160,6 +169,8 @@ export default function DrawerItem(props: Props) {
onPress,
pressColor,
pressOpacity,
testID,
accessibilityLabel,
...rest
} = props;

Expand All @@ -178,8 +189,10 @@ export default function DrawerItem(props: Props) {
style={[styles.container, { borderRadius, backgroundColor }, style]}
>
<LinkPressable
testID={testID}
onPress={onPress}
style={[styles.wrapper, { borderRadius }]}
accessibilityLabel={accessibilityLabel}
accessibilityRole="button"
accessibilityState={{ selected: focused }}
pressColor={pressColor}
Expand Down

0 comments on commit e7cbdf7

Please sign in to comment.