From 7cd0b42ca09b224b65ccd8d629675dedc8f9d5fc Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 14 Jul 2025 19:43:12 -0700 Subject: [PATCH] Add text examples combining textAlign, attachments, script direction, and layout direction (#52445) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52445 This shows some broken stuff (TM), but also asserts current behaviors Changelog: [Internal] Reviewed By: joevilches Differential Revision: D77702743 fbshipit-source-id: a20d5b09e84d86a16e2443726ac82416b13796a8 --- .../js/examples/Text/TextSharedExamples.js | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/packages/rn-tester/js/examples/Text/TextSharedExamples.js b/packages/rn-tester/js/examples/Text/TextSharedExamples.js index 87baa416978..e45fac6545c 100644 --- a/packages/rn-tester/js/examples/Text/TextSharedExamples.js +++ b/packages/rn-tester/js/examples/Text/TextSharedExamples.js @@ -110,6 +110,85 @@ function NumberOfLinesTextLayoutExample(): React.Node { ); } +component RtlInlineViewExample( + label: string, + testID: string, + children: React.Node, +) { + return ( + + + {label} + + {children} + + ); +} + +component RtlAndInlineViewsExample() { + return ( + + + + مَٰنِ ٱلرَّحِيمِ + + + + + + + Hello + {' '} + World! + + + + + + + مَٰنِ ٱلرَّحِيمِ + + + + + + مَٰنِ ٱلرَّحِيمِ + + + + + + + مَٰنِ ٱلرَّحِيمِ + Hello + + + + + + + Hello + + مَٰنِ ٱلرَّحِيمِ + + + + + ); +} + export default [ { title: 'Empty Text', @@ -124,6 +203,13 @@ export default [ expect: 'The red box should align correctly with the rest of the text.', render: TextInlineViewsExample, }, + { + title: 'RTL and Inline Views', + name: 'rtlInlineViews', + description: 'RTL Script and Layout Direction, Combined with Inline Views', + scrollable: true, + render: RtlAndInlineViewsExample, + }, { title: 'numberOfLines with onTextLayout', name: 'numberOfLinesLayout',