mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add support for elevation prop in Fabric
Summary: This diff adds support elevation prop in Fabric core, additionally it adds this prop as non collapsable on the view flattening algorithm changelog: [Internal] internal change in fabric to support elevation prop Reviewed By: JoshuaGross Differential Revision: D21896465 fbshipit-source-id: e0854acc0b2ac30eaf3f82d615aab1cf378cc530
This commit is contained in:
committed by
Facebook GitHub Bot
parent
851d01b0aa
commit
d676558a30
@@ -92,7 +92,9 @@ ViewProps::ViewProps(ViewProps const &sourceProps, RawProps const &rawProps)
|
||||
rawProps,
|
||||
"collapsable",
|
||||
sourceProps.collapsable,
|
||||
true)){};
|
||||
true)),
|
||||
elevation(
|
||||
convertRawProp(rawProps, "elevation", sourceProps.elevation, {})){};
|
||||
|
||||
#pragma mark - Convenience Methods
|
||||
|
||||
|
||||
@@ -59,6 +59,8 @@ class ViewProps : public YogaStylableProps, public AccessibilityProps {
|
||||
|
||||
bool collapsable{true};
|
||||
|
||||
int elevation{};
|
||||
|
||||
#pragma mark - Convenience Methods
|
||||
|
||||
BorderMetrics resolveBorderMetrics(LayoutMetrics const &layoutMetrics) const;
|
||||
|
||||
@@ -43,6 +43,7 @@ void ViewShadowNode::initialize() noexcept {
|
||||
viewProps.pointerEvents == PointerEventsMode::None ||
|
||||
!viewProps.nativeId.empty() || viewProps.accessible ||
|
||||
viewProps.opacity != 1.0 || viewProps.transform != Transform{} ||
|
||||
viewProps.elevation != 0 ||
|
||||
(viewProps.zIndex != 0 &&
|
||||
viewProps.yogaStyle.positionType() == YGPositionTypeAbsolute) ||
|
||||
viewProps.getClipsContentToBounds() ||
|
||||
|
||||
Reference in New Issue
Block a user