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 @@ -16,6 +16,10 @@
#import <react/utils/ManagedObjectWrapper.h>
#import "RCTLegacyViewManagerInteropCoordinatorAdapter.h"

#if TARGET_OS_OSX // [macOS
#import <React/RCTView.h>
#endif // macOS]

using namespace facebook::react;

static NSString *const kRCTLegacyInteropChildComponentKey = @"childComponentView";
Expand Down Expand Up @@ -210,8 +214,14 @@ - (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask
};

if (!_adapter) {
#if !TARGET_OS_OSX // [macOS]
_adapter = [[RCTLegacyViewManagerInteropCoordinatorAdapter alloc] initWithCoordinator:[self _coordinator]
reactTag:self.tag];
#else // [macOS
_adapter = [[RCTLegacyViewManagerInteropCoordinatorAdapter alloc] initWithCoordinator:[self _coordinator]
reactTag:self.reactTag.integerValue];
#endif // macOS]

_adapter.eventInterceptor = ^(std::string eventName, folly::dynamic event) {
if (weakSelf) {
__typeof(self) strongSelf = weakSelf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,11 @@ - (void)invalidateLayer
return;
}

#if TARGET_OS_OSX // [macOS
// clipsToBounds is stubbed out on macOS because it's not part of NSView
layer.masksToBounds = self.clipsToBounds;
#endif // macOS]

const auto borderMetrics = _props->resolveBorderMetrics(_layoutMetrics);

// Stage 1. Shadow Path
Expand Down
4 changes: 3 additions & 1 deletion packages/react-native/React/Views/RCTView.m
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,11 @@ - (RCTPlatformView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event // [macOS
#if !TARGET_OS_OSX // [macOS]
pointForHitTest = [subview convertPoint:point fromView:self];
#else // [macOS
if ([subview isKindOfClass:[RCTView class]]) {
// Paper and Fabric components use the target view coordinate space for hit testing
if ([subview isKindOfClass:[RCTView class]] || [subview respondsToSelector:@selector(updateProps:oldProps:)]) {
pointForHitTest = [subview convertPoint:point fromView:self];
} else {
// Native macOS views require the point to be in the super view coordinate space for hit testing.
pointForHitTest = point;
}
#endif // macOS]
Expand Down