Skip to content

Commit

Permalink
Fabric: Unsetting FormsStackingContext trait for `ParagraphShadowNo…
Browse files Browse the repository at this point in the history
…de` 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
  • Loading branch information
shergin authored and facebook-github-bot committed Mar 12, 2020
1 parent 4bfe94a commit 147f0f2
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 147f0f2

Please sign in to comment.