Please sign in to comment.
BREAKING - Fix unconstraint sizing in main axis
Summary: This fixes measuring of items in the main axis of a container. Previously items were in a lot of cases measured with UNSPECIFIED instead of AT_MOST. This was to support scrolling containers. The correct way to handle scrolling containers is to instead provide them with their own overflow value to activate this behavior. This is also similar to how the web works. This is a breaking change. Most of your layouts will continue to function as before however some of them might not. Typically this is due to having a `flex: 1` style where it is currently a no-op due to being measured with an undefined size but after this change it may collapse your component to take zero size due to the implicit `flexBasis: 0` now being correctly treated. Removing the bad `flex: 1` style or changing it to `flexGrow: 1` should solve most if not all layout issues your see after this diff. Reviewed By: majak Differential Revision: D3876927 fbshipit-source-id: 81ea1c9d6574dd4564a3333f1b3617cf84b4022f
- Loading branch information...
Showing with 90 additions and 36 deletions.
- +5 −3 Libraries/Components/ScrollView/ScrollView.js
- +0 −1 Libraries/Components/View/ViewStylePropTypes.js
- +13 −0 Libraries/StyleSheet/LayoutPropTypes.js
- +2 −1 React/Base/RCTConvert.m
- +19 −15 React/CSSLayout/CSSLayout.c
- +1 −0 React/CSSLayout/CSSLayout.h
- +10 −0 React/Views/RCTScrollViewManager.m
- +15 −0 React/Views/RCTViewManager.h
- +1 −1 React/Views/RCTViewManager.m
- +1 −1 ReactAndroid/src/main/java/com/facebook/csslayout/CSSLayout.java
- +1 −0 ReactAndroid/src/main/java/com/facebook/csslayout/CSSNode.java
- +1 −0 ReactAndroid/src/main/java/com/facebook/csslayout/CSSOverflow.java
- +12 −14 ReactAndroid/src/main/java/com/facebook/csslayout/LayoutEngine.java
- +7 −0 ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.java
- +2 −0 ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.java