Open amarlette opened 3 years ago
Any progress on this issue? We have a project that needs allowsDirectInteraction on iOS. We are evaluating React Native and if it doesn't have this function we'll look somewhere else. According to the accessibility docs, this feature is not implemented yet.
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.
Apparently adding accessibilityTraits=["allowsDirectInteraction"]
to an element should work, I will be trying it shortly.
https://s-pace.github.io/react-native/docs/accessibility.html
Update: accessibilityTraits=["allowsDirectInteraction"]
was removed in the 0.57 release and was not replaced with anything:
https://reactnative.dev/blog/2018/08/13/react-native-accessibility-updates
Another element should be added to the accessibilityRole called "allowsDirectInteraction". This would solve the problem.
This is a very important feature for our team, please let me know what I can do to get this regression fixed.
One can still use accessibilityRole="allowsDirectInteraction"
even thought TS complains as https://github.com/facebook/react-native/blob/d8739e1d37ceebb9643ca56d66a54aaca330665a/packages/react-native/React/Views/RCTViewManager.m#L33 still has it available.
Requires API Proposal
This issue requires a new API. An API proposal should be added and discussed before proceeding with implementation. The API proposal can be added in the comments of this issue or linked as a separate issue.
Description
There is no way to specify a component to allow direct interaction when using VoiceOver. Components that allow direct interaction will pass through the standard touch events to the component, rather than having these events be intercepted by VoiceOver to trigger its various interaction gestures. This is useful if you are building things such as drawing interfaces which would not properly work with VoiceOvers gesture controls.
React Native version:
v0.63
Expected Behavior
An API would need to be added that would allow for this feature. When this is enabled, touches on the component should act as standard touch events as if a user did not have VoiceOver enabled.
iOS Details
This API should map directly to iOS's
allowsDirectInteraction
trait. This should probably not exist as a "role" in RN, even though that is where most other traits live, since there is no Android equivalent. Having this as a separate iOS-only prop makes it clear that this feature is specific to that platform.