File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -531,10 +531,8 @@ - (void)focus
531531#if !TARGET_OS_OSX // [macOS]
532532 [_backedTextInputView becomeFirstResponder ];
533533#else // [macOS
534- NSWindow *window = _backedTextInputView.window ;
535- if (window) {
536- [window makeFirstResponder: _backedTextInputView];
537- }
534+ NSWindow *window = [_backedTextInputView window ];
535+ [window makeFirstResponder: _backedTextInputView];
538536#endif // macOS]
539537
540538 const auto &props = static_cast <const TextInputProps &>(*_props);
@@ -555,12 +553,9 @@ - (void)blur
555553#if !TARGET_OS_OSX // [macOS]
556554 [_backedTextInputView resignFirstResponder ];
557555#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
561- [window makeFirstResponder: nil ];
562- }
563- #endif // macOS];
556+ NSWindow *window = [_backedTextInputView window ];
557+ [window makeFirstResponder: nil ];
558+ #endif // macOS]
564559}
565560
566561- (void )setTextAndSelection : (NSInteger )eventCount
You can’t perform that action at this time.
0 commit comments