Skip to content

Add experimental longest-line sizing for wrapped Text (#58351) - #58351

Open
Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:export-D118718410
Open

Add experimental longest-line sizing for wrapped Text (#58351)#58351
Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:export-D118718410

Conversation

@Abbondanzo

@Abbondanzo Abbondanzo commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary:

Add experimental_textWidthMode as a Text style for sizing wrapped text to its widest rendered line on Android and iOS. The auto value preserves the existing constrained measurement behavior, while longest-line removes unused horizontal space without changing the line count.

Changelog:
[General][Added] - Add experimental longest-line width sizing for wrapped Text

Reviewed By: javache

Differential Revision: D118718410

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 4, 2026
@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Sep 4, 2026
@meta-codesync

meta-codesync Bot commented Sep 4, 2026

Copy link
Copy Markdown

@Abbondanzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D118718410.

@Abbondanzo

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

🤖 AI code review

Decision: Ready for human review

Overall PR risk: Low. The change is additive and preserves default Text measurement, with new behavior limited to Text that opts into longest-line mode on Android and iOS. The most plausible breakage is narrower measurement or rewrapping for opted-in Text only. No critical or warning findings were reported.

No findings.


This review is advisory — it never blocks a merge and never auto-approves.

@Abbondanzo

Copy link
Copy Markdown
Contributor Author

/review

1 similar comment
@Abbondanzo

Copy link
Copy Markdown
Contributor Author

/review

@meta-codesync meta-codesync Bot changed the title Add longest-line sizing for wrapped Text Add longest-line sizing for wrapped Text (#58351) Sep 9, 2026
Abbondanzo added a commit to Abbondanzo/react-native that referenced this pull request Sep 9, 2026
Summary:
Pull Request resolved: react#58351

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
@meta-codesync meta-codesync Bot changed the title Add longest-line sizing for wrapped Text (#58351) Add experimental longest-line sizing for wrapped Text (#58351) Sep 9, 2026
Abbondanzo added a commit to Abbondanzo/react-native that referenced this pull request Sep 9, 2026
Summary:
Pull Request resolved: react#58351

Add `experimental_textWidthMode` as a Text style for sizing wrapped text to its widest rendered line on Android and iOS. The `auto` value preserves the existing constrained measurement behavior, while `longest-line` removes unused horizontal space without changing the line count.

Changelog:
[General][Added] - Add experimental longest-line width sizing for wrapped `Text`

Reviewed By: javache

Differential Revision: D118718410
Abbondanzo added a commit to Abbondanzo/react-native that referenced this pull request Sep 9, 2026
Summary:
Pull Request resolved: react#58351

Add `experimental_textWidthMode` as a Text style for sizing wrapped text to its widest rendered line on Android and iOS. The `auto` value preserves the existing constrained measurement behavior, while `longest-line` removes unused horizontal space without changing the line count.

Changelog:
[General][Added] - Add experimental longest-line width sizing for wrapped `Text`

Reviewed By: javache

Differential Revision: D118718410
Abbondanzo added a commit to Abbondanzo/react-native that referenced this pull request Sep 9, 2026
Summary:
Pull Request resolved: react#58351

Add `experimental_textWidthMode` as a Text style for sizing wrapped text to its widest rendered line on Android and iOS. The `auto` value preserves the existing constrained measurement behavior, while `longest-line` removes unused horizontal space without changing the line count.

Changelog:
[General][Added] - Add experimental longest-line width sizing for wrapped `Text`

Reviewed By: javache

Differential Revision: D118718410
Summary:
Pull Request resolved: react#58351

Add `experimental_textWidthMode` as a Text style for sizing wrapped text to its widest rendered line on Android and iOS. The `auto` value preserves the existing constrained measurement behavior, while `longest-line` removes unused horizontal space without changing the line count.

Changelog:
[General][Added] - Add experimental longest-line width sizing for wrapped `Text`

Reviewed By: javache

Differential Revision: D118718410
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant