From a61766dbac64dc27a9f5803a443e8e79259e2799 Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Mon, 26 Sep 2016 06:11:49 -0700 Subject: [PATCH] BREAKING - Fix unconstraint sizing in main axis Summary: @public 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 --- .../main/java/com/facebook/react/flat/FlatShadowNode.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/flat/FlatShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/flat/FlatShadowNode.java index 07847f14d..0e87d9ef2 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/flat/FlatShadowNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/FlatShadowNode.java @@ -151,8 +151,9 @@ import com.facebook.react.uimanager.ReactClippingViewGroupHelper; invalidate(); } - @ReactProp(name = "overflow") - public final void setOverflow(String overflow) { + @Override + public void setOverflow(String overflow) { + super.setOverflow(overflow); mClipToBounds = "hidden".equals(overflow); if (mClipToBounds) { mOverflowsContainer = false;