Skip to content

Expose full logical text from PreparedLayoutTextView to a11y/view hierarchy (#59150) - #59150

Open
javache wants to merge 1 commit into
react:mainfrom
javache:export-D125204355
Open

javache wants to merge 1 commit into
react:mainfrom
javache:export-D125204355

Conversation

@javache

@javache javache commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Summary

PreparedLayoutTextView currently derives its exposed text from Layout.getText(). When Android ellipsizes a StaticLayout, that value is backed by TextUtils.Ellipsizer, whose string representation contains the rendered ellipsis instead of the complete source text. Accessibility services and view-hierarchy consumers can therefore receive truncated content.

Preserve the original CharSequence in PreparedLayout and expose it from PreparedLayoutTextView.getText(). Drawing, hit testing, span handling, and selection continue to use the rendered layout text, so visual ellipsizing behaviour is unchanged.

Changelog:
[Android][Fixed] - Preserve complete text for accessibility when prepared text layouts are ellipsized

Reviewed By: derekmeta

Differential Revision: D125204355

@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 Oct 16, 2026
@meta-codesync

meta-codesync Bot commented Oct 16, 2026

Copy link
Copy Markdown

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

@meta-codesync meta-codesync Bot changed the title Expose full logical text from PreparedLayoutTextView to a11y/view hierarchy Expose full logical text from PreparedLayoutTextView to a11y/view hierarchy (#59150) Oct 16, 2026
javache added a commit to javache/react-native that referenced this pull request Oct 16, 2026
…rarchy (react#59150)

Summary:

## Summary

`PreparedLayoutTextView` currently derives its exposed text from `Layout.getText()`. When Android ellipsizes a `StaticLayout`, that value is backed by `TextUtils.Ellipsizer`, whose string representation contains the rendered ellipsis instead of the complete source text. Accessibility services and view-hierarchy consumers can therefore receive truncated content.

Preserve the original `CharSequence` in `PreparedLayout` and expose it from `PreparedLayoutTextView.getText()`. Drawing, hit testing, span handling, and selection continue to use the rendered layout text, so visual ellipsizing behaviour is unchanged.

Changelog:
[Android][Fixed] - Preserve complete text for accessibility when prepared text layouts are ellipsized

Reviewed By: derekmeta

Differential Revision: D125204355
javache added a commit to javache/react-native that referenced this pull request Oct 16, 2026
…rarchy (react#59150)

Summary:

## Summary

`PreparedLayoutTextView` currently derives its exposed text from `Layout.getText()`. When Android ellipsizes a `StaticLayout`, that value is backed by `TextUtils.Ellipsizer`, whose string representation contains the rendered ellipsis instead of the complete source text. Accessibility services and view-hierarchy consumers can therefore receive truncated content.

Preserve the original `CharSequence` in `PreparedLayout` and expose it from `PreparedLayoutTextView.getText()`. Drawing, hit testing, span handling, and selection continue to use the rendered layout text, so visual ellipsizing behaviour is unchanged.

Changelog:
[Android][Fixed] - Preserve complete text for accessibility when prepared text layouts are ellipsized

Reviewed By: derekmeta

Differential Revision: D125204355
javache added a commit to javache/react-native that referenced this pull request Oct 16, 2026
…rarchy (react#59150)

Summary:
Pull Request resolved: react#59150

## Summary

`PreparedLayoutTextView` currently derives its exposed text from `Layout.getText()`. When Android ellipsizes a `StaticLayout`, that value is backed by `TextUtils.Ellipsizer`, whose string representation contains the rendered ellipsis instead of the complete source text. Accessibility services and view-hierarchy consumers can therefore receive truncated content.

Preserve the original `CharSequence` in `PreparedLayout` and expose it from `PreparedLayoutTextView.getText()`. Drawing, hit testing, span handling, and selection continue to use the rendered layout text, so visual ellipsizing behaviour is unchanged.

Changelog:
[Android][Fixed] - Preserve complete text for accessibility when prepared text layouts are ellipsized

Reviewed By: derekmeta

Differential Revision: D125204355
…rarchy (react#59150)

Summary:
Pull Request resolved: react#59150

## Summary

`PreparedLayoutTextView` currently derives its exposed text from `Layout.getText()`. When Android ellipsizes a `StaticLayout`, that value is backed by `TextUtils.Ellipsizer`, whose string representation contains the rendered ellipsis instead of the complete source text. Accessibility services and view-hierarchy consumers can therefore receive truncated content.

Preserve the original `CharSequence` in `PreparedLayout` and expose it from `PreparedLayoutTextView.getText()`. Drawing, hit testing, span handling, and selection continue to use the rendered layout text, so visual ellipsizing behaviour is unchanged.

Changelog:
[Android][Fixed] - Preserve complete text for accessibility when prepared text layouts are ellipsized

Reviewed By: derekmeta

Differential Revision: D125204355

This branch has not been deployed

No deployments
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