Environment
- react-native -v: 20.0.0 (CLI), react-native 0.81.6
- npm ls react-native-macos: react-native-macos@0.81.3
- node -v: v20.18.2
- npm -v: 10.8.2
- xcodebuild -version: Xcode 26.3, Build version 17C529
Steps to reproduce the bug
- Create a React Native macOS app using react-native-macos 0.81.3 with Fabric enabled (default in RN 0.81)
- Add a
<Text selectable>Hello World</Text> component
- Build and run on macOS
- Try to click and drag to select the text
Expected Behavior
Text should be selectable and copyable when selectable={true} is set, matching the behavior on iOS and the old architecture on macOS.
Actual Behavior
The selectable prop is completely ignored. Text cannot be selected or copied.
Root Cause
In React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm, the isSelectable handling is wrapped in #if !TARGET_OS_OSX, which means on macOS the selectable prop is skipped entirely:
// Line 123-131 of RCTParagraphComponentView.mm
if (newParagraphProps.isSelectable != oldParagraphProps.isSelectable) {
#if !TARGET_OS_OSX // [macOS]
if (newParagraphProps.isSelectable) {
[self enableContextMenu];
} else {
[self disableContextMenu];
}
#endif // [macOS]
}
The old architecture (RCTTextView.mm) does handle this correctly on macOS:
// RCTTextView.mm - old architecture, works correctly
#else // [macOS
_textView.selectable = _selectable;
if (_selectable) {
[self setFocusable:YES];
}
#endif // macOS]
The Fabric component view needs equivalent macOS selection support — setting _textView.selectable and enabling focus, similar to what the old architecture does.
Reproducible Demo
Minimal reproduction:
import React from 'react';
import { View, Text } from 'react-native';
export default function App() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text selectable>Try to select this text on macOS with Fabric enabled</Text>
</View>
);
}
Additional context
- The
selectable prop works correctly on the old architecture (non-Fabric) on macOS
- The
userSelect: 'text' style also does not work as a workaround
RCTParagraphComponentView.mm also references isSelectable for canPerformAction: (copy:) and acceptsFirstResponder, but the actual selection enabling in updateProps is gated behind !TARGET_OS_OSX
- This affects react-native-macos 0.81.3 with the New Architecture enabled (default in RN 0.81)
Environment
Steps to reproduce the bug
<Text selectable>Hello World</Text>componentExpected Behavior
Text should be selectable and copyable when
selectable={true}is set, matching the behavior on iOS and the old architecture on macOS.Actual Behavior
The
selectableprop is completely ignored. Text cannot be selected or copied.Root Cause
In
React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm, theisSelectablehandling is wrapped in#if !TARGET_OS_OSX, which means on macOS the selectable prop is skipped entirely:The old architecture (
RCTTextView.mm) does handle this correctly on macOS:The Fabric component view needs equivalent macOS selection support — setting
_textView.selectableand enabling focus, similar to what the old architecture does.Reproducible Demo
Minimal reproduction:
Additional context
selectableprop works correctly on the old architecture (non-Fabric) on macOSuserSelect: 'text'style also does not work as a workaroundRCTParagraphComponentView.mmalso referencesisSelectableforcanPerformAction:(copy:) andacceptsFirstResponder, but the actual selection enabling inupdatePropsis gated behind!TARGET_OS_OSX