Skip to content

Commit

Permalink
Fixes regression of prop parsing for elevation (#38959)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #38959

When refactoring ViewProps in D47492635, `elevation` prop parsing was dropped. This restores it.

## Changelog:
[General] [Fixed] - Fabric regression for elevation prop in Android

Reviewed By: mdvacca

Differential Revision: D48269510

fbshipit-source-id: 26dbc7dbdcaadb3dad537226656abd9aee4d05a9
  • Loading branch information
rozele authored and facebook-github-bot committed Aug 11, 2023
1 parent d655d44 commit ec42ae0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ class BaseViewProps : public YogaStylableProps, public AccessibilityProps {

LayoutConformance experimental_layoutConformance{};

Float elevation{}; /* Android-only */

#pragma mark - Convenience Methods

BorderMetrics resolveBorderMetrics(LayoutMetrics const &layoutMetrics) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ HostPlatformViewProps::HostPlatformViewProps(
RawProps const &rawProps,
bool shouldSetRawProps)
: BaseViewProps(context, sourceProps, rawProps, shouldSetRawProps),
elevation(
CoreFeatures::enablePropIteratorSetter ? sourceProps.elevation
: convertRawProp(
context,
rawProps,
"elevation",
sourceProps.elevation,
{})),
nativeBackground(
CoreFeatures::enablePropIteratorSetter
? sourceProps.nativeBackground
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class HostPlatformViewProps : public BaseViewProps {

#pragma mark - Props

Float elevation{};

std::optional<NativeDrawable> nativeBackground{};
std::optional<NativeDrawable> nativeForeground{};

Expand Down

0 comments on commit ec42ae0

Please sign in to comment.