fix(iOS): boxShadow + overflow hidden
combination affecting pointer event box-none
and scale transform.
#52413
+6
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
This issue is only reproducible with combination of
overflow: hidden
andboxShadow
i.e. when a container view is added to the hierarchy.Case 1:
Here the view has
box-none
but it will still trigger the press event because this line returns the_containerView
ashitView
and this condition gets fullfilled (since it is not self). To fix this issue we should iterate onself.currentContainerView.subviews
.Case 2:
Transform scale clipping child view.
The above style hides the child view on iOS whereas it is visible on android.
This happens because
containerView
usesself.frame
property which gets mutated due to scale transform. So containerView becomesactualSize * scale * scale
instead ofactualSize * 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 useself.bounds
instead ofself.frame
when setting the frame for container.Changelog:
[IOS] [FIXED] - boxShadow + overflow hidden combination interfering with pointerEvents and transform scale.
Test Plan:
Test above example snippets and pointer events examples in RNTester.
cc - @joevilches