AccessibilityInfo.setAccessibilityFocus does not work with Samsung Voice Assistant
See original GitHub issueDescription
According to the documentation, AccessibilityInfo.setAccessibilityFocus should set the screen reader’s focus to the given component across all platforms. However, on Samsung devices the call does nothing; that is, focus remains where it was before setAccessibilityFocus was called. The function works as expected in iOS and on Google phones.
The accessibility documentation contains an Android-specific example of setting focus using the native Accessibility Event system, but that code does not work on Samsung phones either. According to the AccessibilityInfo docs, setAccessibilityFocus uses the AccessibilityEvent system behind the scenes, so it makes sense that it wouldn’t work to use it directly either.
This is a major accessibility issue, as it makes building accessible overlays, dropdown menus, etc. extremely difficult. A fix would be very useful for the community.
React Native version:
System:
OS: macOS 10.15.3
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Memory: 84.73 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.13.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.13.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.8.4 - /usr/local/bin/pod
SDKs:
iOS SDK: Not Found
Android SDK: Not Found
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5900203
Xcode: /undefined - /usr/bin/xcodebuild
Languages:
Java: 13.0.1 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: ^16.13.1 => 16.13.1
react-native: 0.62.2 => 0.62.2
npmGlobalPackages:
*react-native*: Not Found
Steps To Reproduce
- Open the attached Expo snack on a physical Samsung device
- Enable Voice Assistant (Settings > Accessibility > Screen Reader > Voice Assistant)
- Navigate back to the Expo app and highlight the button labeled “Select to set focus to bottom text”
- Double tap to activate the button and observe.
Expected Results
Focus should shift to the text at the bottom of the screen, “Jump to me!”.
Snack, code example, screenshot, or link to a repository:
The repro can be found in this snack: https://snack.expo.io/mMl5DkO!7 I was also able to reproduce the issue in a standalone Typescript project: https://github.com/Shanghai-/ReactNativeFocusProblem
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)
Top GitHub Comments
+1. Can confirm same problem on a Samsung Galaxy Note S9
Feel free to re-open if this comes up again, but at this point Samsung has abandoned Voice Assistant and now ships devices with Talkback. Closing out.