Skip to content

Commit bbdc12e

Browse files
yungstersfacebook-github-bot
authored andcommitted
RN: Add Overflow Visible Kill Switch (Android)
Summary: Adds a kill switch that reverts the default behavior of `overflow` to be hidden again. The intent of this kill switch is to give applications more time to migrate if necessary (e.g. if they are depending on third party packages with native components that are not compatible with `overflow` being visible by default). To use the flag, simply set: import com.facebook.react.views.view.ReactViewGroup; // Somewhere in the initialization of your application. ReactViewGroup.sDefaultOverflowHidden = true; Reviewed By: achen1 Differential Revision: D8718963 fbshipit-source-id: 0eb9aee45dfe04e9ae34d86e3bedcd30a185ef82
1 parent c1831d5 commit bbdc12e

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ public class ReactViewGroup extends ViewGroup implements
4949
ReactInterceptingViewGroup, ReactClippingViewGroup, ReactPointerEventsView, ReactHitSlopView,
5050
ReactZIndexedViewGroup {
5151

52+
/**
53+
* Kill switch to make overflow hidden by default. This flag will eventually be removed.
54+
*/
55+
publicstaticbooleansDefaultOverflowHidden;
56+
5257
privatestaticfinalintARRAY_CAPACITY_INCREMENT = 12;
5358
privatestaticfinalintDEFAULT_BACKGROUND_COLOR = Color.TRANSPARENT;
5459
privatestaticfinalLayoutParamssDefaultLayoutParam = newViewGroup.LayoutParams(0, 0);
@@ -113,7 +118,10 @@ public void onLayoutChange(
113118

114119
publicReactViewGroup(Contextcontext) {
115120
super(context);
116-
setClipChildren(false);
121+
// TODO: Remove this check after a couple public releases.
122+
if (!sDefaultOverflowHidden) {
123+
setClipChildren(false);
124+
}
117125
mDrawingOrderHelper = newViewGroupDrawingOrderHelper(this);
118126
}
119127

0 commit comments

Comments
 (0)