-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Correct way to move accessibility focus #37015
Comments
|
Hello @robertKozik , |
Hi guys, @robertKozik I've read the conversation you had about this on the expensify's github (url), would you be so kind to sent me the video link if it's on youtube? |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
@robertKozik Have you found solution for that? Facing the same issue |
I see this got closed due to inactivity but this is very much still an issue on our end |
This needs to be reopened. |
Hello there, Based on the original post and information about https://www.npmjs.com/package/react-native-a11y-focus
P.S. It makes sense to extend the library with additional functionality, such as autofocus and keyboard focus. I will consider this and try to add it in the upcoming releases. |
Description
On my project I want to move the accessibility (f.e. VoiceOver) focus on a different component, but I can't find any good, well documented, approach. The use-case is f.e. that after clicking the button I want to open the modal and focus proper component inside that modal.
I found two different solutions, but both of them has some flaws:
AccessibilityInfo.setAccessibilityFocus
. But this method requiresreactTag
which can be only obtained with deprecatedfindNodeHandle
functionAccessibilityInfo.sendAccessibilityEvent
passing "focus" and component ref. The problem with this one is that it's not documented method.In documentation I've also found the usage on
focus()
method on ref, but it's not defined on the accessible and focusable View component (No command found with name "focus").What is the correct way of moving accessibility focus in "post-findNodeHandle" world?
React Native Version
0.70.5
Output of
npx react-native info
System:
OS: macOS 13.1
CPU: (10) arm64 Apple M1 Pro
Memory: 72.63 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 19.7.0 - ~/.nvm/versions/node/v19.7.0/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 9.5.1 - ~/.nvm/versions/node/v19.7.0/bin/npm
Watchman: 2023.02.13.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8815526
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 11.0.14.1 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.5 => 0.70.5
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
Snack, code example, screenshot, or link to a repository
https://snack.expo.dev/@rooobi/accessibility-focus
The text was updated successfully, but these errors were encountered: