diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index 4aafb8c88cb954..4b282fb0b99b69 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -531,10 +531,8 @@ - (void)focus #if !TARGET_OS_OSX // [macOS] [_backedTextInputView becomeFirstResponder]; #else // [macOS - NSWindow *window = _backedTextInputView.window; - if (window) { - [window makeFirstResponder:_backedTextInputView]; - } + NSWindow *window = [_backedTextInputView window]; + [window makeFirstResponder:_backedTextInputView]; #endif // macOS] const auto &props = static_cast(*_props); @@ -555,12 +553,9 @@ - (void)blur #if !TARGET_OS_OSX // [macOS] [_backedTextInputView resignFirstResponder]; #else // [macOS - NSWindow *window = _backedTextInputView.window; - if (window && window.firstResponder == _backedTextInputView) { - // Calling makeFirstResponder with nil will call resignFirstResponder and make the window the first responder - [window makeFirstResponder:nil]; - } -#endif // macOS]; + NSWindow *window = [_backedTextInputView window]; + [window makeFirstResponder:nil]; +#endif // macOS] } - (void)setTextAndSelection:(NSInteger)eventCount