This repository was archived by the owner on Nov 27, 2022. It is now read-only.
Invalid UIAccessibilityTraits - Possible Fix #1262
danonimob
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As JH Lin found out on Medium, react-native-tab-view can throw this error sometimes. Coincidence or not, both projects - his and mine - use ViroReact to some degree.
After some time I realized it was something hardcoded into the library that could not be changed through props. After some digging, I found it.
Turns out the AccessibilityRole for some elements in the TabBar is hardcoded in the Library.
Inside node_modules/react-native-tab-view/src/TabBarItem.tsx you will find:
accessibilityRole: "tab"
In my case, I changed it to:
accessibilityRole: 'text'
Then inside node_modules/react-native-tab-view/src/TabBar.tsx you will find:
accessibilityRole: "tablist"
In my case, I changed it to:
accessibilityRole: 'none'
That's it. No more issues. (:
Beta Was this translation helpful? Give feedback.
All reactions