-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
contentInsets always overwrites scrollIndicatorInsets of ScrollView/ListView #13025
Comments
Thanks for reporting this. Would you consider sending a PR? It seems like you've already done some of the work here. |
…book#13025 Fix to avoid contentInsets always overwrites scrollIndicatorInsets of ScrollView/ListView. According to issue facebook#13025 https://github.com/facebook/react-native/blob/a8391bde7d757d01521a6d12170fb9090c17a6a0/React/Views/RCTView.m#L299 always overide `scrollIndicatorInsets` when called and only works when `contentInsets` is not set. We only need to worry about when `contentInsets` is set, We only have to check and reset it after `autoAdjustInsetsForView` is called.
Any update? |
The solution given in the description have been implemented in a previous commit. Does this issue still persist ? |
👋 hey all, thanks for reporting this issue. There was a commit some time ago (timotew@d1b9d32) that was meant to have fixed this issue, because of this I'm going to go ahead and close this issue for now. Should someone be able to provide a reproduction on the latest version of React Native I'd be happy to re-open this, please let me know. Thank you |
Description
I set
contentInsets
andscrollIndicatorInsets
of aScrollView
, actuallyListView
, to different values. But seems the value ofcontentInsets
always overwrites thescrollIndicatorInsets
one.Reproduction
https://sketch.expo.io/Byi2M7psg
In this demo,
scrollIndicatorInsets.top
is 20, it's expected to be 100. After deletingcontentInset={{top: 20, left: 0, right: 0, bottom: 0}}
, thescrollIndicatorInsets
is correct.Solution
On line 262 of https://github.com/facebook/react-native/blob/master/React/Views/RCTView.m#L262
scrollIndicatorInsets
is set tobaseInset
which iscontentInset
most of the time. This method is called whensetContentInset
forRCTScrollView
.On line 372 of https://github.com/facebook/react-native/blob/v0.42.3/React/Views/RCTComponentData.m#L372 when enumerate props, the order should not be predictable, but actually
contentInset
always comes afterscrollIndicatorInsets
during my debugging. SocontentInset
always overwritesscrollIndicatorInsets
unless it's Zero (returned onif (UIEdgeInsetsEqualToEdgeInsets(contentInset, _contentInset)) return
).Additional Information
The text was updated successfully, but these errors were encountered: