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

fix: accessibility in Link component #5795

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/components/primitives/Link/index.tsx
Expand Up @@ -19,6 +19,8 @@ const Link = ({ isHovered: isHoveredProp, ...props }: ILinkProps, ref: any) => {
_text,
href,
onPress,
accessibilityLabel,
accessibilityHint,
isExternal,
...resolvedProps
} = usePropsResolution('Link', props, {
Expand Down Expand Up @@ -53,6 +55,8 @@ const Link = ({ isHovered: isHoveredProp, ...props }: ILinkProps, ref: any) => {
_text={linkTextProps}
ref={mergeRefs([ref, _ref])}
flexDirection="row"
accessibilityLabel={accessibilityLabel}
accessibilityHint={accessibilityHint}
>
{children}
</Box>
Expand All @@ -65,7 +69,12 @@ const Link = ({ isHovered: isHoveredProp, ...props }: ILinkProps, ref: any) => {
>
{React.Children.map(children, (child) =>
typeof child === 'string' || typeof child === 'number' ? (
<Text {...resolvedProps._text} {...linkTextProps}>
<Text
accessibilityLabel={accessibilityLabel}
accessibilityHint={accessibilityHint}
{...resolvedProps._text}
{...linkTextProps}
>
{child}
</Text>
) : (
Expand Down