Skip to content

Commit 1ea45d6

Browse files
authored
Enable inline links on macOS to respond to interaction events (#3812)
* Port logic for inline link for macOS * Change files * Add comment
1 parent f7387ef commit 1ea45d6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Port logic for inline link for macOS",
4+
"packageName": "@fluentui-react-native/link",
5+
"email": "ruaraki@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

packages/components/Link/src/Link.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ export const Link = compose<LinkType>({
4343
// This is a workaround for the issue. Once those issues are resolved, supportsA11yTextInText can be removed.
4444
const supportsA11yTextInText = Platform.OS !== 'android';
4545

46-
return supportsA11yTextInText && (inline || mergedProps.selectable) ? (
46+
// MacOS Text component doesn't handle interaction events like hover etc.
47+
// which are needed to style links correctly. Since macOS can handle
48+
// Views in Text, we use that to handle interactions instead.
49+
const supportsInteractionOnText = Platform.OS !== 'macos';
50+
51+
return supportsA11yTextInText && supportsInteractionOnText && (inline || mergedProps.selectable) ? (
4752
<Slots.content {...mergedProps}>{children}</Slots.content>
4853
) : (
4954
<Slots.root {...mergedProps}>

0 commit comments

Comments
 (0)