From bcc482e6559e5731e32889459cfadb5e6ba415ac Mon Sep 17 00:00:00 2001 From: David Vacca Date: Mon, 15 Jul 2019 18:29:17 -0700 Subject: [PATCH] Fix parsing of textAlign props in C++ Summary: This diff fixes the parsing of the textAlign prop in Fabric. The current parsing does not support 'justify' or 'auto' values. See https://facebook.github.io/react-native/docs/0.59/text-style-props#textalign for more details about the values of these props in the JS side. Reviewed By: shergin Differential Revision: D16269509 fbshipit-source-id: e0d9168d6022245430de644f7c4e45c968b1326b --- ReactCommon/fabric/attributedstring/conversions.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ReactCommon/fabric/attributedstring/conversions.h b/ReactCommon/fabric/attributedstring/conversions.h index 76a6823e7fc..0a029a6b67b 100644 --- a/ReactCommon/fabric/attributedstring/conversions.h +++ b/ReactCommon/fabric/attributedstring/conversions.h @@ -198,7 +198,7 @@ inline std::string toString(const FontVariant &fontVariant) { inline void fromRawValue(const RawValue &value, TextAlignment &result) { auto string = (std::string)value; - if (string == "natural") { + if (string == "auto") { result = TextAlignment::Natural; return; } @@ -214,7 +214,7 @@ inline void fromRawValue(const RawValue &value, TextAlignment &result) { result = TextAlignment::Right; return; } - if (string == "justified") { + if (string == "justify") { result = TextAlignment::Justified; return; } @@ -276,13 +276,13 @@ inline void fromRawValue( result = TextDecorationLineType::Underline; return; } - + // TODO: remove "line-through" after deprecation if (string == "strikethrough" || string == "line-through") { result = TextDecorationLineType::Strikethrough; return; } - + // TODO: remove "underline line-through" after "line-through" deprecation if (string == "underline-strikethrough" || string == "underline line-through") { result = TextDecorationLineType::UnderlineStrikethrough;