Content-Length: 275743 | pFad | http://github.com/facebook/react-native/pull/49381

43 Allow text links to be navigatable via keyboard by default v2 by joevilches · Pull Request #49381 · facebook/react-native · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow text links to be navigatable via keyboard by default v2 #49381

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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

… 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.

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

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.

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

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

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 p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/facebook/react-native/pull/49381

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy