Skip to content
Merged
Changes from 3 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 @@ -31,7 +31,7 @@
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
#if !TARGET_OS_OSX // [macOS]

Check failure on line 34 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / macos, newarch

unterminated conditional directive

Check failure on line 34 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / macos, oldarch

unterminated conditional directive

Check failure on line 34 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / visionos, oldarch

unterminated conditional directive

Check failure on line 34 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / ios, newarch

unterminated conditional directive

Check failure on line 34 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / visionos, newarch

unterminated conditional directive

Check failure on line 34 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / ios, oldarch

unterminated conditional directive
// We set the default behavior to "never" so that iOS
// doesn't do weird things to UIScrollView insets automatically
// and keeps it as an opt-in behavior.
Expand All @@ -41,7 +41,30 @@
// 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;
#endif // [macOS]
#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;
#if !TARGET_OS_OSX // [macOS]
// We set the default behavior to "never" so that iOS
// doesn't do weird things to UIScrollView insets automatically
// and keeps it as an opt-in behavior.
self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
#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]

// We intentionally force `UIScrollView`s `semanticContentAttribute` to `LTR` here
// 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;

Check failure on line 66 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / macos, newarch

use of undeclared identifier 'UISemanticContentAttributeForceLeftToRight'

Check failure on line 66 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / macos, newarch

property 'semanticContentAttribute' not found on object of type 'RCTEnhancedScrollView *'

Check failure on line 66 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / macos, oldarch

use of undeclared identifier 'UISemanticContentAttributeForceLeftToRight'

Check failure on line 66 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / macos, oldarch

property 'semanticContentAttribute' not found on object of type 'RCTEnhancedScrollView *'

Comment thread
Saadnajmi marked this conversation as resolved.
Outdated

__weak __typeof(self) weakSelf = self;
_delegateSplitter = [[RCTGenericDelegateSplitter alloc] initWithDelegateUpdateBlock:^(id delegate) {
Expand Down Expand Up @@ -299,4 +322,4 @@
scrollView.contentSize.width > self.frame.size.width;
}

@end

Check failure on line 325 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / visionos, oldarch

missing '@EnD'

Check failure on line 325 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / visionos, oldarch

expected '}'

Check failure on line 325 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / visionos, oldarch

expected '}'

Check failure on line 325 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / ios, newarch

missing '@EnD'

Check failure on line 325 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / ios, newarch

expected '}'

Check failure on line 325 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / ios, newarch

expected '}'

Check failure on line 325 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / visionos, newarch

missing '@EnD'

Check failure on line 325 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / visionos, newarch

expected '}'

Check failure on line 325 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / visionos, newarch

expected '}'

Check failure on line 325 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / ios, oldarch

missing '@EnD'

Check failure on line 325 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / ios, oldarch

expected '}'

Check failure on line 325 in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm

View workflow job for this annotation

GitHub Actions / Build RNTester / ios, oldarch

expected '}'
Loading