Skip to content

Conversation

@joevilches
Copy link
Contributor

Summary:
A much improved version of my previous attempt in D68306316 (#48773).

Instead of LinkMovementMethod which makes TextViews scrollable if they overflow, this implementation uses ExploreByTouchHelper's onVirtualViewKeyboardFocusChanged and onPerformActionForVirtualView to handle focus changes and clicks on virtual views (aka spans in our case). This impl will correctly ellipsize text and allow tab to nav through the links.

Differential Revision: D69551206

@facebook-github-bot facebook-github-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 Feb 12, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D69551206

joevilches added a commit to joevilches/react-native that referenced this pull request Feb 13, 2025
…ok#49381)

Summary:

A much improved version of my previous attempt in D68306316 (facebook#48773).

Instead of LinkMovementMethod which makes TextViews scrollable if they overflow, this implementation uses `ExploreByTouchHelper`'s `onVirtualViewKeyboardFocusChanged` and `onPerformActionForVirtualView` to handle focus changes and clicks on virtual views (aka spans in our case). This impl will correctly ellipsize text and allow tab to nav through the links.

Differential Revision: D69551206
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D69551206

joevilches added a commit to joevilches/react-native that referenced this pull request Feb 19, 2025
…ok#49381)

Summary:

A much improved version of my previous attempt in D68306316 (facebook#48773).

Instead of LinkMovementMethod which makes TextViews scrollable if they overflow, this implementation uses `ExploreByTouchHelper`'s `onVirtualViewKeyboardFocusChanged` and `onPerformActionForVirtualView` to handle focus changes and clicks on virtual views (aka spans in our case). This impl will correctly ellipsize text and allow tab to nav through the links.

Differential Revision: D69551206
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D69551206

joevilches added a commit to joevilches/react-native that referenced this pull request Feb 19, 2025
…ok#49381)

Summary:

A much improved version of my previous attempt in D68306316 (facebook#48773).

Instead of LinkMovementMethod which makes TextViews scrollable if they overflow, this implementation uses `ExploreByTouchHelper`'s `onVirtualViewKeyboardFocusChanged` and `onPerformActionForVirtualView` to handle focus changes and clicks on virtual views (aka spans in our case). This impl will correctly ellipsize text and allow tab to nav through the links.

Differential Revision: D69551206
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D69551206

joevilches added a commit to joevilches/react-native that referenced this pull request Feb 20, 2025
…ok#49381)

Summary:

A much improved version of my previous attempt in D68306316 (facebook#48773).

Instead of LinkMovementMethod which makes TextViews scrollable if they overflow, this implementation uses `ExploreByTouchHelper`'s `onVirtualViewKeyboardFocusChanged` and `onPerformActionForVirtualView` to handle focus changes and clicks on virtual views (aka spans in our case). This impl will correctly ellipsize text and allow tab to nav through the links.

Reviewed By: NickGerleman

Differential Revision: D69551206
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D69551206

… to subclass (facebook#49377)

Summary:

ReactAccessibilityDelegate exists to handle much of the accessibility tasks in the various Views in RN. There is quite a bit of text specific logic, mostly related to virtual views and nested links within a TextView. 

I decided to subclass this into a TextView-specific version because I need this delegate to reference TextView or ReactClickableSpan, which live under `react/views` while ReactAccessibilityDelegate live under `react/uimanager`. The former depends on the latter, so making the latter depend on the former would for a dependency cycle that would break builds. I thought about making a separate package for this but both `react/views` and `react/uimanager` need to include ReactAccessibilityDelegate so we would still have a cycle.

mAccessibilityLinks is only set on ReactTextViewManager, so this is purely a text thing. Subclassing is not the most ideal as it extends the inheritance chain some more but I do not see a better option.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D69499115
…eak TalkBack

Summary:
Whenever we remove a link in some text we do not properly update the accessibility delegate to respond to this change. As a result we still think that there are nodes to access around the spans

Changelog: [Android][Fixed] - Fix text link accessibility on state update removal

Reviewed By: NickGerleman, mdvacca

Differential Revision: D69551906
…ok#49381)

Summary:

A much improved version of my previous attempt in D68306316 (facebook#48773).

Instead of LinkMovementMethod which makes TextViews scrollable if they overflow, this implementation uses `ExploreByTouchHelper`'s `onVirtualViewKeyboardFocusChanged` and `onPerformActionForVirtualView` to handle focus changes and clicks on virtual views (aka spans in our case). This impl will correctly ellipsize text and allow tab to nav through the links.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D69551206
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D69551206

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 22, 2025
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in a003be0.

gabrieldonadel pushed a commit to gabrieldonadel/react-native that referenced this pull request Aug 12, 2025
…ok#49381)

Summary:
Pull Request resolved: facebook#49381

A much improved version of my previous attempt in D68306316 (facebook#48773).

Instead of LinkMovementMethod which makes TextViews scrollable if they overflow, this implementation uses `ExploreByTouchHelper`'s `onVirtualViewKeyboardFocusChanged` and `onPerformActionForVirtualView` to handle focus changes and clicks on virtual views (aka spans in our case). This impl will correctly ellipsize text and allow tab to nav through the links.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D69551206

fbshipit-source-id: 6a88ccd507dc5534c1f494e3303c6bfc2bae5e9f
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. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants