From 147f0f2eecf6856539c1ea0b8a967c96d5c1c0e6 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Wed, 11 Mar 2020 22:41:54 -0700 Subject: [PATCH] Fabric: Unsetting `FormsStackingContext` trait for `ParagraphShadowNode` on Android Summary: Unsetting `FormsStackingContext` trait is essential on Android where we can't mount views inside `TextView`. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20268038 fbshipit-source-id: e754bf1631a0c3147694fb6b34bb1d9e78148894 --- .../fabric/components/text/paragraph/ParagraphShadowNode.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.h b/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.h index 87255915826..cd7591149d7 100644 --- a/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.h +++ b/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.h @@ -42,6 +42,13 @@ class ParagraphShadowNode : public ConcreteViewShadowNode< auto traits = ConcreteViewShadowNode::BaseTraits(); traits.set(ShadowNodeTraits::Trait::LeafYogaNode); traits.set(ShadowNodeTraits::Trait::TextKind); + +#ifdef ANDROID + // Unsetting `FormsStackingContext` trait is essential on Android where we + // can't mount views inside `TextView`. + traits.unset(ShadowNodeTraits::Trait::FormsStackingContext); +#endif + return traits; }