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

Enable inline links on macOS to respond to interaction events #3812

Merged
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Port logic for inline link for macOS",
"packageName": "@fluentui-react-native/link",
"email": "[email protected]",
"dependentChangeType": "patch"
}
7 changes: 6 additions & 1 deletion packages/components/Link/src/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ export const Link = compose<LinkType>({
// This is a workaround for the issue. Once those issues are resolved, supportsA11yTextInText can be removed.
const supportsA11yTextInText = Platform.OS !== 'android';

return supportsA11yTextInText && (inline || mergedProps.selectable) ? (
// MacOS Text component doesn't handle interaction events like hover etc.
rurikoaraki marked this conversation as resolved.
Show resolved Hide resolved
// which are needed to style links correctly. Since macOS can handle
// Views in Text, we use that to handle interactions instead.
const supportsInteractionOnText = Platform.OS !== 'macos';

return supportsA11yTextInText && supportsInteractionOnText && (inline || mergedProps.selectable) ? (
<Slots.content {...mergedProps}>{children}</Slots.content>
) : (
<Slots.root {...mergedProps}>
Expand Down
Loading