-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix scrollIndicatorInsets on iOS 13 #27102
Conversation
Hello @radex, thank you for the PR. I am unable to reproduce the problem, could you please send me a repro so I can verify that this fix works? |
@@ -299,6 +299,12 @@ - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher | |||
} | |||
#endif | |||
|
|||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is to have conditional compilation together with @available(iOS 13.0, *)
check.
Using @available(iOS 13.0, *)
is preferred.
This applies to the code below as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is, and it seems to be a convention in RN project.
@available(iOS 13.0, *)
is a runtime check, and #if ... __IPHONE_OS_VERSION_MAX_ALLOWED
check is for SDK the project is compiled against.
I can re-check but I think if you tried to compile this code in Xcode 10.2 or earlier, it would fail to compile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe @radex may be referring to RCTAppearance.mm where I used this pattern as Dark Mode is new to iOS 13:
react-native/React/CoreModules/RCTAppearance.mm
Lines 28 to 29 in aff6bad
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0 | |
if (@available(iOS 13.0, *)) { |
@sammy-SC do you still want this change to be made?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hramos is there any reason to have conditional compilation there? If not, then let's remove it.
Is there any status update on this PR? |
I believe this has been resolved by #29809 so will close this for now. |
Summary
scrollIndicatorInsets
seems to be broken on iOS 13. I think this might be an iOS bug? Or maybe a behavior change. Either way, it's a regression for React Native users. SettingautomaticallyAdjustsScrollIndicatorInsets = NO
fixes the behavior + we stop using deprecatedscrollIndicatorInsets
if possibleChangelog
[iOS] [Fixed] - Fixed
ScrollView
'sscrollIndicatorInsets
prop on iOS 13Test Plan