From c8e5f9766b8caaf66aa61ef48eeab740a10a725a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nishan=20=28o=5E=E2=96=BD=5Eo=29?= Date: Thu, 18 Sep 2025 14:06:00 -0700 Subject: [PATCH] fix(iOS): `boxShadow + overflow hidden` combination affecting pointer event `box-none` and scale transform. (#52413) Summary: This issue is only reproducible with combination of `overflow: hidden` and `boxShadow` i.e. when a [container view](https://github.com/facebook/react-native/blob/2ce7eab5f998788ffa8346b63cc4901d026456ba/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm#L799) is added to the hierarchy. ### Case 1: ```jsx { alert("Tapped"); }} /> ``` Here the view has `box-none` but it will still trigger the press event because this [line](https://github.com/facebook/react-native/blob/2ce7eab5f998788ffa8346b63cc4901d026456ba/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm#L658) returns the `_containerView` as `hitView` and this condition gets [fullfilled](https://github.com/facebook/react-native/blob/2ce7eab5f998788ffa8346b63cc4901d026456ba/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm#L676) (since it is not self). To fix this issue we should iterate on `self.currentContainerView.subviews`. ### Case 2: Transform scale clipping child view. ```jsx { alert("parent view"); }} > { alert("child view"); }} > Press me ; ``` The above style hides the child view on iOS whereas it is visible on android. | iOS | Android | |---|---| | | | This happens because `containerView` uses `self.frame` property which gets mutated due to scale transform. So containerView becomes `actualSize * scale * scale` instead of `actualSize * scale` and ends up clipping child views because of overflow hidden. Please checkout the layout hierarchy in the below screenshot. To fix it we need to use `self.bounds` instead of `self.frame` when setting the frame for container. ## Changelog: [IOS] [FIXED] - boxShadow + overflow hidden combination interfering with pointerEvents and transform scale.