mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
b07a65b9d9
Summary: # Problem `UIManager::getRelativeLayoutMetrics` returns incorrect `frame.origin.y` value. Just quick reiteration how calculation of `frame.origin` works. We take frame of the target shadow node, travers hierarchy to the root and keep adding `frame.origin` of each ancestor to target shadow node's origin. One more important piece of information, to calculate scroll view's `frame.origin`, we need to have its contentOffset which gets passed to Fabric core through state. # So where does it go wrong? Problem is that on Android, calling view command `scrollTo` doesn't set its internal state correctly. So when we calculate the layoutmetrics, scroll view's `frame.origin` is off by whatever value was used in `scrollTo`. # The fix In `ReactScrollView`, correctly set state after `scrollTo` is called on it. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D19835549 fbshipit-source-id: d56e7b0b05023c0497e52c8b46fdcf58ca78b4a5