File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed 
packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput Expand file tree Collapse file tree 1 file changed +5
-8
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,11 @@ - (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
556+   NSWindow  *window = [_backedTextInputView window ];
557+   if  ([window firstResponder ] == _backedTextInputView) {
561558    [window makeFirstResponder: nil ];
562559  }
563- #endif  //  macOS]; 
560+ #endif  //  macOS]
564561}
565562
566563- (void )setTextAndSelection : (NSInteger )eventCount 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments