Skip to content

Commit 3ea16bd

Browse files
lenaicNick
andauthored
Remove TextInput cursor color changes with selectionColor prop changes (#1792)
* Don't change cursor color when setting the selection color for TextInput. * Add a note to the TextInput example warning about the macOS specific behavior. --------- Co-authored-by: Nick <lefever@meta.com>
1 parent 3e66909 commit 3ea16bd

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Libraries/Text/TextInput/Multiline/RCTUITextView.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ - (void)setSelectionColor:(RCTUIColor *)selectionColor
152152
NSMutableDictionary *selectTextAttributes = self.selectedTextAttributes.mutableCopy;
153153
selectTextAttributes[NSBackgroundColorAttributeName] = selectionColor ?: [NSColor selectedControlColor];
154154
self.selectedTextAttributes = selectTextAttributes.copy;
155-
self.insertionPointColor = _cursorColor ?: self.selectionColor ?: [NSColor textColor];
156155
}
157156

158157
- (RCTUIColor*)selectionColor

packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ function OnPaste(): React.Node {
454454
</>
455455
);
456456
}
457-
// [macOS]
457+
// macOS]
458458

459459
exports.displayName = (undefined: ?string);
460460
exports.title = 'TextInput';
@@ -608,6 +608,10 @@ exports.examples = ([
608608
},
609609
{
610610
title: 'Colored highlight/cursor for text input',
611+
// [macOS
612+
description:
613+
('Note: On macOS, the selectionColor prop does not change the cursor color.': string),
614+
// macOS]
611615
render: function (): React.Node {
612616
return (
613617
<View>
@@ -1158,4 +1162,4 @@ if (Platform.OS === 'macos') {
11581162
},
11591163
);
11601164
}
1161-
// [macOS]
1165+
// macOS]

0 commit comments

Comments
 (0)