Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #897 from cds-snc/issue/888/external-link-a11y
Browse files Browse the repository at this point in the history
Announce 'double tap to activate' on external links with Talkback
  • Loading branch information
nickmly committed Aug 14, 2020
2 parents eb3968b + edd44a0 commit 65b6732
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/ButtonSingleLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const ButtonSingleLine = ({
justifyContent="center"
// eslint-disable-next-line react-native/no-inline-styles
style={{
backgroundColor: Platform.OS === 'ios' ? color : 'transparent',
backgroundColor: Platform.OS === 'ios' || externalLink ? color : 'transparent',
minHeight: height,
borderWidth,
borderColor: buttonColor,
Expand Down Expand Up @@ -122,7 +122,17 @@ export const ButtonSingleLine = ({
};

if (Platform.OS === 'android') {
return (
return externalLink ? (
<TouchableOpacity
accessible
disabled={disabled}
onPress={onPressHandler}
activeOpacity={0.6}
{...accessibilityProps}
>
{content}
</TouchableOpacity>
) : (
<Ripple
disabled={disabled}
onPress={onPressHandler}
Expand Down

0 comments on commit 65b6732

Please sign in to comment.