mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Support ScrollAway in ReactScrollView
Summary: Support ScrollAway in ReactScrollView for Fabric/non-Fabric. Changelog: [Android][Added] Support for ScrollAway native nav bars added to ReactScrollView Reviewed By: mdvacca Differential Revision: D28308855 fbshipit-source-id: 9a922159ef50fb7c8e9c484a4b97ca57ab248496
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d87542ee4c
commit
0ef5beee85
@@ -34,7 +34,7 @@ void ScrollViewShadowNode::updateStateIfNeeded() {
|
||||
void ScrollViewShadowNode::updateScrollContentOffsetIfNeeded() {
|
||||
#ifndef ANDROID
|
||||
if (getLayoutMetrics().layoutDirection == LayoutDirection::RightToLeft) {
|
||||
// Yoga place `contentView` on the right side of `scrollView` when RTL
|
||||
// Yoga places `contentView` on the right side of `scrollView` when RTL
|
||||
// layout is enforced. To correct for this, in RTL setting, correct the
|
||||
// frame's origin. React Native Classic does this as well in
|
||||
// `RCTScrollContentShadowView.m`.
|
||||
@@ -58,8 +58,9 @@ void ScrollViewShadowNode::layout(LayoutContext layoutContext) {
|
||||
}
|
||||
|
||||
Point ScrollViewShadowNode::getContentOriginOffset() const {
|
||||
auto contentOffset = getStateData().contentOffset;
|
||||
return {-contentOffset.x, -contentOffset.y};
|
||||
auto stateData = getStateData();
|
||||
auto contentOffset = stateData.contentOffset;
|
||||
return {-contentOffset.x, -contentOffset.y + stateData.scrollAwayPaddingTop};
|
||||
}
|
||||
|
||||
} // namespace react
|
||||
|
||||
Reference in New Issue
Block a user