Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ - (void)didMoveToWindow

if (self.window && !_textInput) {
if (self.nativeId) {
_textInput = RCTFindTextInputWithNativeId(self.window, self.nativeId);
#if !TARGET_OS_OSX // [macOS]
_textInput = RCTFindTextInputWithNativeId(self.window, self.nativeId);
_textInput.inputAccessoryView = _contentView;
#endif // [macOS]
#else // [macOS
_textInput = RCTFindTextInputWithNativeId(self.window.contentView, self.nativeId);
#endif // macOS]
} else {
_textInput = RCTFindTextInputWithNativeId(_contentView, nil);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ - (instancetype)initWithFrame:(CGRect)frame

- (RCTUIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event // [macOS]
{
RCTUIView *result = [super hitTest:point withEvent:event]; // [macOS]
RCTUIView *result = (RCTUIView *)[super hitTest:point withEvent:event]; // [macOS]

if (result == _adapter.paperView) {
return self;
Expand Down Expand Up @@ -197,9 +197,9 @@ - (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask

for (NSDictionary *mountInstruction in _viewsToBeMounted) {
NSNumber *index = mountInstruction[kRCTLegacyInteropChildIndexKey];
UIView *childView = mountInstruction[kRCTLegacyInteropChildComponentKey];
RCTUIView *childView = mountInstruction[kRCTLegacyInteropChildComponentKey]; // [macOS]
if ([childView isKindOfClass:[RCTLegacyViewManagerInteropComponentView class]]) {
UIView *target = ((RCTLegacyViewManagerInteropComponentView *)childView).contentView;
RCTUIView *target = ((RCTLegacyViewManagerInteropComponentView *)childView).contentView; // [macOS]
[_adapter.paperView insertReactSubview:target atIndex:index.integerValue];
} else {
[_adapter.paperView insertReactSubview:childView atIndex:index.integerValue];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ - (void)didMoveToWindow
if (self.window && !_didMoveToWindow) {
auto const &props = *std::static_pointer_cast<TextInputProps const>(_props);
if (props.autoFocus) {
#if !TARGET_OS_OSX // [macOS]
[_backedTextInputView becomeFirstResponder];
#endif // [macOS]
}
_didMoveToWindow = YES;
}
Expand Down
2 changes: 2 additions & 0 deletions React/Fabric/Mounting/RCTComponentViewRegistry.mm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ - (instancetype)init

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// Calling this a bit later, when the main thread is probably idle while JavaScript thread is busy.
#if !TARGET_OS_OSX // [macOS]
[self preallocateViewComponents];
#endif // [macOS]
});
}

Expand Down
4 changes: 3 additions & 1 deletion React/Fabric/Mounting/UIView+ComponentViewProtocol.mm
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ - (void)updateLayoutMetrics:(LayoutMetrics const &)layoutMetrics
// Therefore, we must use `center` and `bounds`.
#if !TARGET_OS_OSX // [macOS]
self.center = CGPoint{CGRectGetMidX(frame), CGRectGetMidY(frame)};
#endif // [macOS]
#else // [macOS
self.frame = frame;
#endif // macOS]
self.bounds = CGRect{CGPointZero, frame.size};
}
}
Expand Down