Skip to content

Commit 9eb68a5

Browse files
fabriziocuccimeta-codesync[bot]
authored andcommitted
Remove enableClipChildrenForOverflowHidden logic (#55546)
Summary: Pull Request resolved: #55546 Changelog: [Internal] It looks like we have completely misunderstood the semantic of `clipChildren`. Looking at the Android [source code](https://cs.android.com/android/platform/superproject/+/android-latest-release:frameworks/base/core/java/android/view/ViewGroup.java;l=4607?q=setClipToPadding&ss=android%2Fplatform%2Fsuperproject&fbclid=IwY2xjawP8LExleHRuA2FlbQIxMQBzcnRjBmFwcF9pZAEwAAEeQkZx96WcTaA0mIUVGXeFAxH_aLVBMR0an0N8jeKCYX4E-j9HW0eLnzZcSJI_aem__yWzHP0_x-bPxCQS1nN19w), it seems that `setClipChildren(true)` on a ViewGroup X means clipping **each child** to the **child's own bounds**, not the parent's bound. Which means also [this](https://www.internalfb.com/code/aosp-vendor-meta-coresdk/[oculus-14.0%3Af0b9166acbb68da2e1e9f7622ba1b7fcee672ebc]/api-src/volumetricwindow/java/horizonos/view/interaction/providers/ViewInteractionNodeProvider.java?lines=502) line in HzOS is based on the same incorrect assumption. Ultimately, RN should not be populating `clipChildren` when `overflow: hidden` is set. Reviewed By: javache Differential Revision: D93237429 fbshipit-source-id: 0c3b18c829ef3880f8cc931263792c50aafa1333
1 parent 6f54846 commit 9eb68a5

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

  • packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -819,9 +819,6 @@ public open class ReactViewGroup public constructor(context: Context?) :
819819
} else {
820820
Overflow.fromString(overflow)
821821
}
822-
if (ReactNativeFeatureFlags.enableClipChildrenForOverflowHidden()) {
823-
clipChildren = (_overflow == Overflow.HIDDEN)
824-
}
825822
invalidate()
826823
}
827824

0 commit comments

Comments
 (0)