diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm index a7bc9c5b442569..949daf661f41cd 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm @@ -41,6 +41,12 @@ - (instancetype)initWithFrame:(CGRect)frame // because this attribute affects a position of vertical scrollbar; we don't want this // scrollbar flip because we also flip it with whole `UIScrollView` flip. self.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight; +#else // [macOS + // Similar to iOS's contentInsetAdjustmentBehavior fix + // For example: When using NSWindowStyleMaskFullSizeContentView (hidden title bar) and ScrollView as root, + // NSScrollView.automaticallyAdjustsContentInsets (default YES) adds contentInset.top to push content below the toolbar. + // However, React Native doesn't know about this native contentInset adjustments,causing some caltulation issues + self.automaticallyAdjustsContentInsets = NO; #endif // [macOS] __weak __typeof(self) weakSelf = self;