mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Back out "Account for diffrent frame size when using maintainVisibleContentPosition in virtualized lists" (#47125)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47125 Original commit changeset: 9f05a461d178 Original Phabricator Diff: D64238887 Changelog: [Internal] NOTE: while this seems to work on IGVR it breaks on the two use cases highlighted in D64339251, backing out the diff while trying to find out a solution that works on all cases! Reviewed By: Abbondanzo Differential Revision: D64611594 fbshipit-source-id: b43353b17448c181a76b2af09968cf0e4934c53c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
16ceb6f74c
commit
f3e37e29e2
+2
-6
@@ -115,9 +115,7 @@ class MaintainVisibleScrollPositionHelper<ScrollViewT extends ViewGroup & HasSmo
|
||||
firstVisibleView.getHitRect(newFrame);
|
||||
|
||||
if (mHorizontal) {
|
||||
int deltaX =
|
||||
(newFrame.left - mPrevFirstVisibleFrame.left)
|
||||
+ (newFrame.width() - mPrevFirstVisibleFrame.width());
|
||||
int deltaX = newFrame.left - mPrevFirstVisibleFrame.left;
|
||||
if (deltaX != 0) {
|
||||
int scrollX = mScrollView.getScrollX();
|
||||
mScrollView.scrollToPreservingMomentum(scrollX + deltaX, mScrollView.getScrollY());
|
||||
@@ -128,9 +126,7 @@ class MaintainVisibleScrollPositionHelper<ScrollViewT extends ViewGroup & HasSmo
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int deltaY =
|
||||
(newFrame.top - mPrevFirstVisibleFrame.top)
|
||||
+ (newFrame.height() - mPrevFirstVisibleFrame.height());
|
||||
int deltaY = newFrame.top - mPrevFirstVisibleFrame.top;
|
||||
if (deltaY != 0) {
|
||||
int scrollY = mScrollView.getScrollY();
|
||||
mScrollView.scrollToPreservingMomentum(mScrollView.getScrollX(), scrollY + deltaY);
|
||||
|
||||
Reference in New Issue
Block a user