File tree 1 file changed +5
-8
lines changed
packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput
1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -531,10 +531,8 @@ - (void)focus
531
531
#if !TARGET_OS_OSX // [macOS]
532
532
[_backedTextInputView becomeFirstResponder ];
533
533
#else // [macOS
534
- NSWindow *window = _backedTextInputView.window ;
535
- if (window) {
536
- [window makeFirstResponder: _backedTextInputView];
537
- }
534
+ NSWindow *window = [_backedTextInputView window ];
535
+ [window makeFirstResponder: _backedTextInputView];
538
536
#endif // macOS]
539
537
540
538
const auto &props = static_cast <const TextInputProps &>(*_props);
@@ -555,12 +553,11 @@ - (void)blur
555
553
#if !TARGET_OS_OSX // [macOS]
556
554
[_backedTextInputView resignFirstResponder ];
557
555
#else // [macOS
558
- NSWindow *window = _backedTextInputView.window ;
559
- if (window && window.firstResponder == _backedTextInputView) {
560
- // Calling makeFirstResponder with nil will call resignFirstResponder and make the window the first responder
556
+ NSWindow *window = [_backedTextInputView window ];
557
+ if ([window firstResponder ] == _backedTextInputView) {
561
558
[window makeFirstResponder: nil ];
562
559
}
563
- #endif // macOS];
560
+ #endif // macOS]
564
561
}
565
562
566
563
- (void )setTextAndSelection : (NSInteger )eventCount
You can’t perform that action at this time.
0 commit comments