diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm index 95142a605c0c..ea70105798ab 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm @@ -25,6 +25,7 @@ void RCTCopyBackedTextInput( toTextInput.attributedText = RCTSanitizeAttributedString(fromTextInput.attributedText); toTextInput.placeholder = fromTextInput.placeholder; toTextInput.placeholderColor = fromTextInput.placeholderColor; + toTextInput.tintColor = fromTextInput.tintColor; toTextInput.textContainerInset = fromTextInput.textContainerInset; toTextInput.inputAccessoryView = fromTextInput.inputAccessoryView; toTextInput.textInputDelegate = fromTextInput.textInputDelegate; diff --git a/packages/react-native/React/Tests/Text/RCTTextInputUtilsTest.mm b/packages/react-native/React/Tests/Text/RCTTextInputUtilsTest.mm new file mode 100644 index 000000000000..2559670f8658 --- /dev/null +++ b/packages/react-native/React/Tests/Text/RCTTextInputUtilsTest.mm @@ -0,0 +1,29 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import +#import + +@interface RCTTextInputUtilsTest : XCTestCase +@end + +@implementation RCTTextInputUtilsTest + +- (void)testCopyBackedTextInputPreservesTintColor +{ + RCTUITextField *source = [RCTUITextField new]; + RCTUITextView *destination = [RCTUITextView new]; + source.tintColor = UIColor.redColor; + + RCTCopyBackedTextInput(source, destination); + + XCTAssertEqualObjects(destination.tintColor, UIColor.redColor); +} + +@end