Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

validRole and validTraits restricted #72

Closed
ajsmth opened this issue Nov 3, 2019 · 3 comments
Closed

validRole and validTraits restricted #72

ajsmth opened this issue Nov 3, 2019 · 3 comments
Labels

Comments

@ajsmth
Copy link
Contributor

ajsmth commented Nov 3, 2019

I'm wondering why there are only a few options that can be selected via queryByRole as defined in role.js:

const validRoles = [
  'adjustable',
  'button',
  'header',
  'image',
  'imagebutton',
  'keyboardKey',
  'link',
  'none',
  'search',
  'summary',
  'text',
];

const validTraits = [
  'adjustable',
  'allowsDirectInteraction',
  'button',
  'disabled',
  'frequentUpdates',
  'header',
  'image',
  'key',
  'link',
  'none',
  'pageTurn',
  'plays',
  'search',
  'selected',
  'startsMedia',
  'summary',
  'text',
];

Looks like there's a whole bunch of other roles that are defined by React Native: https://facebook.github.io/react-native/docs/accessibility#accessibilityrole-ios-android

I'm wondering if this was a design decision, and if so how we could override / configure this

@bcarroll22
Copy link
Collaborator

Hey thanks for pointing this one out too! In one of the more recent releases of RN, probably 60, they added a lot more accessibility options. This feature was implemented before the extended list of roles was available. It wasn't an intentional omission, just hasn't been updated yet. We can add all of the currently available roles so that they're available for queries as well.

@ajsmth
Copy link
Contributor Author

ajsmth commented Nov 4, 2019

awesome -- i can add these if you'd like!

@bcarroll22
Copy link
Collaborator

🎉 This issue has been resolved in version 5.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants