From 43de8ea2ba3927cef5cd12c6cc35257907472a05 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 12 May 2020 10:29:06 -0700 Subject: [PATCH] Fix opacity not being animated on Text component Reviewed By: shergin Differential Revision: D21523725 fbshipit-source-id: 80be40fd1314b7e1cbaa827ca52f917ba5bc916e --- .../fabric/components/text/basetext/BaseTextProps.h | 2 +- .../fabric/components/text/paragraph/ParagraphProps.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ReactCommon/fabric/components/text/basetext/BaseTextProps.h b/ReactCommon/fabric/components/text/basetext/BaseTextProps.h index ba9c7fe4058..5554277f2da 100644 --- a/ReactCommon/fabric/components/text/basetext/BaseTextProps.h +++ b/ReactCommon/fabric/components/text/basetext/BaseTextProps.h @@ -26,7 +26,7 @@ class BaseTextProps { #pragma mark - Props - const TextAttributes textAttributes{}; + TextAttributes textAttributes{}; #pragma mark - DebugStringConvertible (partially) diff --git a/ReactCommon/fabric/components/text/paragraph/ParagraphProps.cpp b/ReactCommon/fabric/components/text/paragraph/ParagraphProps.cpp index 672ad29d787..fc731707084 100644 --- a/ReactCommon/fabric/components/text/paragraph/ParagraphProps.cpp +++ b/ReactCommon/fabric/components/text/paragraph/ParagraphProps.cpp @@ -28,7 +28,14 @@ ParagraphProps::ParagraphProps( rawProps, "selectable", sourceProps.isSelectable, - {})){}; + {})) { + /* + * These props are applied to `View`, therefore they must not be a part of + * base text attributes. + */ + textAttributes.opacity = std::numeric_limits::quiet_NaN(); + textAttributes.backgroundColor = {}; +}; #pragma mark - DebugStringConvertible