From d6484fa1809d6c1b56e819a8024029a9baaa9174 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 9 Mar 2020 05:47:59 -0700 Subject: [PATCH] Add TextKind trait to ParagraphShadowNode and TextInputShadowNode Summary: Adds `TextKind` trait to Paragraph and TextInput shadow nodes. Later on it could cause confusion why they do not have this trait. Changelog: [Internal] Reviewed By: shergin, mdvacca Differential Revision: D20254008 fbshipit-source-id: 56fb264fa4fe38a5f00f080558cdc7992fd51fea --- .../fabric/components/text/paragraph/ParagraphShadowNode.h | 2 +- .../components/textinput/iostextinput/TextInputShadowNode.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.h b/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.h index e82fd18295e..a2ef23dc68e 100644 --- a/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.h +++ b/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.h @@ -41,7 +41,7 @@ class ParagraphShadowNode : public ConcreteViewShadowNode< static ShadowNodeTraits BaseTraits() { auto traits = ConcreteViewShadowNode::BaseTraits(); traits.set(ShadowNodeTraits::Trait::LeafYogaNode); - + traits.set(ShadowNodeTraits::Trait::TextKind); return traits; } diff --git a/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.h b/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.h index 435e5b7da9f..96d3192c22d 100644 --- a/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.h +++ b/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.h @@ -33,6 +33,12 @@ class TextInputShadowNode : public ConcreteViewShadowNode< public: using ConcreteViewShadowNode::ConcreteViewShadowNode; + static ShadowNodeTraits BaseTraits() { + auto traits = ConcreteViewShadowNode::BaseTraits(); + traits.set(ShadowNodeTraits::Trait::TextKind); + return traits; + } + /* * Returns a `AttributedString` which represents text content of the node. */