Skip to content

Commit c7ecd3c

Browse files
Nick LefeverSaadnajmi
authored andcommitted
[fabric] Add responder property to backing text input view protocol
Summary: Add a `responder` property to support assigning the first responder to the actual textfield/textview if the view is wrapped or not. The wrapped text view already implements this property. This diff brings the same functionality to the text field and declares it on the common protocol. Test Plan: Tested later in this stack. Reviewers: shawndempsey, chpurrer, #rn-desktop Reviewed By: shawndempsey, chpurrer Differential Revision: https://phabricator.intern.facebook.com/D51962395 Tasks: T167538822, T157889591
1 parent 0994e37 commit c7ecd3c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
3838
@property (nonatomic, assign, readonly) BOOL textWasPasted;
3939
#else // [macOS
4040
@property (nonatomic, assign) BOOL textWasPasted;
41+
@property (nonatomic, readonly) NSResponder *responder;
4142
#endif // macOS]
4243
@property (nonatomic, assign, readonly) BOOL dictationRecognizing;
4344
@property (nonatomic, assign) UIEdgeInsets textContainerInset;

packages/react-native/Libraries/Text/TextInput/Singleline/RCTUITextField.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ - (void)setTextContainerInset:(UIEdgeInsets)textContainerInset
217217

218218
#if TARGET_OS_OSX // [macOS
219219

220+
- (NSResponder *)responder
221+
{
222+
return self;
223+
}
224+
220225
+ (Class)cellClass
221226
{
222227
return RCTUITextFieldCell.class;

0 commit comments

Comments
 (0)