mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix Transform flip example on new renderer (#39259)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39259 This matches the [behaviour we had in the old renderer](https://github.com/facebook/react-native/blob/main/packages/react-native/React/Views/UIView%2BReact.m#L145) where zIndex is mapped to the CALayer's zPosition. This is required to prevent clipping of views in rotation transforms as currently used in the TransformExample. Changelog: [iOS][Fixed] Rotation transforms are no longer clipped when zIndex is applied Reviewed By: christophpurrer Differential Revision: D48905010 fbshipit-source-id: 56dea38da94ae32a88bbce3f29c3cce9ddbbf010
This commit is contained in:
committed by
Facebook GitHub Bot
parent
99a306dd9e
commit
850349b1d2
+5
@@ -371,6 +371,11 @@ using namespace facebook::react;
|
||||
self.accessibilityIdentifier = RCTNSStringFromString(newViewProps.testId);
|
||||
}
|
||||
|
||||
// `zIndex`
|
||||
if (oldViewProps.zIndex != newViewProps.zIndex) {
|
||||
self.layer.zPosition = newViewProps.zIndex.value_or(0);
|
||||
}
|
||||
|
||||
_needsInvalidateLayer = _needsInvalidateLayer || needsInvalidateLayer;
|
||||
|
||||
_props = std::static_pointer_cast<const ViewProps>(props);
|
||||
|
||||
@@ -255,6 +255,7 @@ const styles = StyleSheet.create({
|
||||
justifyContent: 'center',
|
||||
backgroundColor: 'blue',
|
||||
backfaceVisibility: 'hidden',
|
||||
zIndex: 1024,
|
||||
},
|
||||
flipCard1: {
|
||||
position: 'absolute',
|
||||
|
||||
Reference in New Issue
Block a user