Teach ReactTextView Hit Testing/a11y about Facsimile State (Fixes hit testing/a11y for selectable Text in Facsimile)#55559
Closed
NickGerleman wants to merge 5 commits intofacebook:mainfrom
Closed
Conversation
|
@NickGerleman has exported this pull request. If you are a Meta employee, you can view the originating Diff in D93346617. |
2717d2b to
a3aa1a0
Compare
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Feb 20, 2026
… testing/a11y for selectable Text in Facsimile) (facebook#55559) Summary: When enablePreparedTextLayout is true, we may reuse layouts (including backing `Spannable`), even when ShadowNode generation changes. React tags are subject to change during this period, so we have an extra layer of indirection, that users of `PreparedLayout` based state currently have to deal with. This adds that logic so that hit testing, a11y delegate, and spans against FragmentIndex, all work in the scenario of ReactTextView with Facsimile state, used for selectable text. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D93346617
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Feb 23, 2026
… testing/a11y for selectable Text in Facsimile) (facebook#55559) Summary: When enablePreparedTextLayout is true, we may reuse layouts (including backing `Spannable`), even when ShadowNode generation changes. React tags are subject to change during this period, so we have an extra layer of indirection, that users of `PreparedLayout` based state currently have to deal with. This adds that logic so that hit testing, a11y delegate, and spans against FragmentIndex, all work in the scenario of ReactTextView with Facsimile state, used for selectable text. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D93346617
a3aa1a0 to
ee2f51f
Compare
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Feb 23, 2026
… testing/a11y for selectable Text in Facsimile) (facebook#55559) Summary: Pull Request resolved: facebook#55559 When enablePreparedTextLayout is true, we may reuse layouts (including backing `Spannable`), even when ShadowNode generation changes. React tags are subject to change during this period, so we have an extra layer of indirection, that users of `PreparedLayout` based state currently have to deal with. This adds that logic so that hit testing, a11y delegate, and spans against FragmentIndex, all work in the scenario of ReactTextView with Facsimile state, used for selectable text. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D93346617
337c58a to
2d7961e
Compare
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
85151e6 to
4e1a1ea
Compare
Summary: Extract ParagraphComponentDescriptor logic into a template base class BaseParagraphComponentDescriptor<ShadowNodeT> so that other paragraph-like component descriptors can reuse the same TextLayoutManager wiring. Remove `final` from ParagraphShadowNode to allow subclassing. Move TextLayoutManagerKey from extern linkage in .cpp to constexpr in the new header. This is a pure refactor with no behavioral change. Changelog: [Internal] Differential Revision: D93829402
Summary: Add the native components needed to route selectable text through ReactTextView instead of PreparedLayoutTextView when enablePreparedTextLayout is on. C++ side: Add SelectableParagraphShadowNode (inherits ParagraphShadowNode) and SelectableParagraphComponentDescriptor (inherits BaseParagraphComponentDescriptor). Register in CoreComponentsRegistry and componentNameByReactViewName. Android side: Make ReactTextViewManager open so it can be subclassed. Add getReactTextUpdateFromPreparedLayout to handle ReferenceStateWrapper holding PreparedLayout. Create SelectableTextViewManager (extends ReactTextViewManager, registered as RCTSelectableText). Add FabricNameComponentMapping entry for SelectableParagraph -> RCTSelectableText. No JS code references RCTSelectableText yet, so the new components are inert. Changelog: [Internal] Differential Revision: D93829400
Differential Revision: D93829403
Summary: Wire up the JS side to use the new SelectableTextViewManager native component. When enablePreparedTextLayout() is on, NativeSelectableText resolves to RCTSelectableText, routing selectable text through ReactTextView instead of PreparedLayoutTextView. When the flag is off, NativeSelectableText falls back to NativeText, so behavior is identical to before. Refactor NativePressableText and NativePressableVirtualText from arrow function component expressions to component declarations (PressableText and PressableVirtualText). PressableText now accepts a selectable prop to choose between NativeSelectableText and NativeText. Add a check(!isSelectable) guard in PreparedLayoutTextViewManager.setSelectable since selectable text now routes to SelectableTextViewManager instead. Changelog: [Internal] Differential Revision: D93829401
4e1a1ea to
48d3e6b
Compare
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Feb 26, 2026
… testing/a11y for selectable Text in Facsimile) (facebook#55559) Summary: When enablePreparedTextLayout is true, we may reuse layouts (including backing `Spannable`), even when ShadowNode generation changes. React tags are subject to change during this period, so we have an extra layer of indirection, that users of `PreparedLayout` based state currently have to deal with. This adds that logic so that hit testing, a11y delegate, and spans against FragmentIndex, all work in the scenario of ReactTextView with Facsimile state, used for selectable text. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D93346617
48d3e6b to
aea759d
Compare
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Feb 26, 2026
… testing/a11y for selectable Text in Facsimile) (facebook#55559) Summary: When enablePreparedTextLayout is true, we may reuse layouts (including backing `Spannable`), even when ShadowNode generation changes. React tags are subject to change during this period, so we have an extra layer of indirection, that users of `PreparedLayout` based state currently have to deal with. This adds that logic so that hit testing, a11y delegate, and spans against FragmentIndex, all work in the scenario of ReactTextView with Facsimile state, used for selectable text. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D93346617
… testing/a11y for selectable Text in Facsimile) (facebook#55559) Summary: Pull Request resolved: facebook#55559 When enablePreparedTextLayout is true, we may reuse layouts (including backing `Spannable`), even when ShadowNode generation changes. React tags are subject to change during this period, so we have an extra layer of indirection, that users of `PreparedLayout` based state currently have to deal with. This adds that logic so that hit testing, a11y delegate, and spans against FragmentIndex, all work in the scenario of ReactTextView with Facsimile state, used for selectable text. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D93346617
aea759d to
2559cd5
Compare
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Feb 26, 2026
… testing/a11y for selectable Text in Facsimile) (facebook#55559) Summary: Pull Request resolved: facebook#55559 When enablePreparedTextLayout is true, we may reuse layouts (including backing `Spannable`), even when ShadowNode generation changes. React tags are subject to change during this period, so we have an extra layer of indirection, that users of `PreparedLayout` based state currently have to deal with. This adds that logic so that hit testing, a11y delegate, and spans against FragmentIndex, all work in the scenario of ReactTextView with Facsimile state, used for selectable text. Changelog: [Internal] Differential Revision: D93346617 Reviewed By: mdvacca
|
This pull request has been merged in b2ccbb2. |
zoontek
pushed a commit
to zoontek/react-native
that referenced
this pull request
Mar 9, 2026
… testing/a11y for selectable Text in Facsimile) (facebook#55559) Summary: Pull Request resolved: facebook#55559 When enablePreparedTextLayout is true, we may reuse layouts (including backing `Spannable`), even when ShadowNode generation changes. React tags are subject to change during this period, so we have an extra layer of indirection, that users of `PreparedLayout` based state currently have to deal with. This adds that logic so that hit testing, a11y delegate, and spans against FragmentIndex, all work in the scenario of ReactTextView with Facsimile state, used for selectable text. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D93346617 fbshipit-source-id: a9d01b1b560430396dcf23962be56d07e2dec838
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
When enablePreparedTextLayout is true, we may reuse layouts (including backing
Spannable), even when ShadowNode generation changes. React tags are subject to change during this period, so we have an extra layer of indirection, that users ofPreparedLayoutbased state currently have to deal with.This adds that logic so that hit testing, a11y delegate, and spans against FragmentIndex, all work in the scenario of ReactTextView with Facsimile state, used for selectable text.
Changelog: [Internal]
Differential Revision: D93346617