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 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:
- Move focus with help of
AccessibilityInfo.setAccessibilityFocus
. But this method requires reactTag which can be only obtained with deprecatedfindNodeHandle
function - Use
AccessibilityInfo.sendAccessibilityEvent
passing "focus" and component ref. The problem with this one is that it's not documented method.
I'm expecting to find the approach which won't involve any deprecated methods and will be documented.