Skip to content

Commit 9d326ef

Browse files
authored
fix(fabric): Disable TextInput prop enablesReturnKeyAutomatically on macOS (#2283)
1 parent 57fc114 commit 9d326ef

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/react-native/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ NS_ASSUME_NONNULL_BEGIN
5151
@property (nonatomic, assign) BOOL contextMenuHidden;
5252
@property (nonatomic, assign, getter=isEditable) BOOL editable;
5353
@property (nonatomic, assign) BOOL caretHidden;
54-
@property (nonatomic, assign) BOOL enablesReturnKeyAutomatically;
5554
#if !TARGET_OS_OSX // [macOS]
55+
@property (nonatomic, assign) BOOL enablesReturnKeyAutomatically;
5656
@property (nonatomic, assign) UITextFieldViewMode clearButtonMode;
5757
#endif // [macOS]
5858
@property (nonatomic, getter=isScrollEnabled) BOOL scrollEnabled;

packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
183183
_backedTextInputView.editable = newTextInputProps.traits.editable;
184184
}
185185

186+
#if !TARGET_OS_OSX // [macOS]
186187
if (newTextInputProps.traits.enablesReturnKeyAutomatically !=
187188
oldTextInputProps.traits.enablesReturnKeyAutomatically) {
188189
_backedTextInputView.enablesReturnKeyAutomatically = newTextInputProps.traits.enablesReturnKeyAutomatically;
189190
}
190191

191-
#if !TARGET_OS_OSX // [macOS]
192192
if (newTextInputProps.traits.keyboardAppearance != oldTextInputProps.traits.keyboardAppearance) {
193193
_backedTextInputView.keyboardAppearance =
194194
RCTUIKeyboardAppearanceFromKeyboardAppearance(newTextInputProps.traits.keyboardAppearance);

0 commit comments

Comments
 (0)