mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: There are a couple scenarios where flattening the child of a ScrollView can cause problems. 1. `maintainVisibleContentPosition` on both Android and iOS rely on reading live positions in the view tree 2. `snapToAlignment` on Android uses live view tree, for items to snap to. iOS seems to have very different behavior, and aligns assuming that children are scroll view height, or that a snap interval has been set. This change adds a prop `collapsableChildren` which can be used to disable children of scroll content view from being collapsed. Differentiator is... complicated... but we can mostly just adapt the code dealing with existing traits at the surface level. Changelog: [General][Fixed] - Automatically disable flattening of scroll content view children when needed [General][Added] - Add `collapsableChildren` prop Reviewed By: javache Differential Revision: D56226241 fbshipit-source-id: ed81f7fff5a15eac424708f763afc9b844aefa9c