react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Automatically disable flattening of scroll content view children when needed

Open NickGerleman opened this issue 1 year ago • 1 comments

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.

Differential Revision: D56226241

NickGerleman avatar Apr 22 '24 20:04 NickGerleman

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 19,410,732 -47
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 22,784,375 +78
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 876914be556ca62d6aa77ec101debf09062b8922 Branch: main

analysis-bot avatar Apr 22 '24 21:04 analysis-bot

Merged as https://github.com/facebook/react-native/commit/7b44c8d1d0a089a766c7eab1b5435b2dbf61454c

javache avatar Jun 27 '24 21:06 javache