Changed RCTTextView to check for failed focus
Reviewed By: nicklockwood Differential Revision: D3378236 fbshipit-source-id: b4a33f7808ffe116b51631cde35f5cd0042caee9
This commit is contained in:
parent
03512fb721
commit
724134746b
|
@ -48,6 +48,14 @@
|
|||
_jsRequestingFirstResponder = NO;
|
||||
}
|
||||
|
||||
- (void)didMoveToWindow
|
||||
{
|
||||
if (_jsRequestingFirstResponder) {
|
||||
[self becomeFirstResponder];
|
||||
[self reactDidMakeFirstResponder];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation RCTTextView
|
||||
|
|
|
@ -1032,8 +1032,9 @@ RCT_EXPORT_METHOD(focus:(nonnull NSNumber *)reactTag)
|
|||
[self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
||||
UIView *newResponder = viewRegistry[reactTag];
|
||||
[newResponder reactWillMakeFirstResponder];
|
||||
[newResponder becomeFirstResponder];
|
||||
[newResponder reactDidMakeFirstResponder];
|
||||
if ([newResponder becomeFirstResponder]) {
|
||||
[newResponder reactDidMakeFirstResponder];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue