Add longest-line sizing for wrapped Text - #58351
Conversation
Summary: Add `textWidthMode="longest-line"` to size wrapped `Text` to its widest rendered line on Android and iOS. This keeps content-proportional spacing in horizontal layouts without an `onTextLayout` round trip; the default measurement behavior is unchanged. Changelog: [General][Added] - Add `textWidthMode="longest-line"` for sizing wrapped `Text` to its widest rendered line. Differential Revision: D118718410
|
@Abbondanzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D118718410. |
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
|
/review |
🤖 AI code reviewDecision: Ready for human review Overall PR risk: Low. The change is additive and gated by a new optional prop, so existing Text measurement stays on the Default path when the prop is unset. Blast radius is limited to Text measurement and ParagraphAttributes identity with direct rollback by removing the prop. No defect findings were kept; the most plausible breakage is longest-line width diverging between platforms for wrapped text. No findings. This review is advisory — it never blocks a merge and never auto-approves. |
Summary:
Add
textWidthMode="longest-line"to size wrappedTextto its widest rendered line on Android and iOS. This keeps content-proportional spacing in horizontal layouts without anonTextLayoutround trip; the default measurement behavior is unchanged.Changelog:
[General][Added] - Add
textWidthMode="longest-line"for sizing wrappedTextto its widest rendered line.Differential Revision: D118718410