File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/react-native/React/CoreModules Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -142,10 +142,10 @@ - (void)showMessage:(NSString *)message color:(RCTUIColor *)color backgroundColo
142142 styleMask: NSWindowStyleMaskBorderless
143143 backing: NSBackingStoreBuffered
144144 defer: YES ];
145- self->_window .releasedWhenClosed = NO ;
146145 self->_window .backgroundColor = [NSColor clearColor ];
147146
148147 NSTextField *label = [[NSTextField alloc ] initWithFrame: self ->_window.contentView.bounds];
148+ label.font = [NSFont monospacedDigitSystemFontOfSize: 12.0 weight: NSFontWeightRegular ];
149149 label.alignment = NSTextAlignmentCenter;
150150 label.bezeled = NO ;
151151 label.editable = NO ;
@@ -169,7 +169,11 @@ - (void)showMessage:(NSString *)message color:(RCTUIColor *)color backgroundColo
169169 self->_label .textColor = color;
170170
171171 self->_label .backgroundColor = backgroundColor;
172- [RCTKeyWindow () beginSheet: self ->_window completionHandler: nil ];
172+ if (![[RCTKeyWindow () sheets ] doesContain: self ->_window]) {
173+ [RCTKeyWindow () beginSheet: self ->_window completionHandler: ^(NSModalResponse returnCode) {
174+ [self ->_window orderOut: self ];
175+ }];
176+ }
173177#endif // macOS]
174178 });
175179
You can’t perform that action at this time.
0 commit comments