-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
why is the accessibilityHint enforced as mandatory? #142
Comments
I'm not a fan of this rule either, for the same reasons. I just disabled it in my .eslintrc config:
|
'react-native-a11y/has-accessibility-hint' is too strict and incorrect in some cases. I think it would be a good idea to turn it off by default. FormidableLabs/eslint-plugin-react-native-a11y#142
'react-native-a11y/has-accessibility-hint' is too strict and incorrect in some cases. I think it would be a good idea to turn it off by default. FormidableLabs/eslint-plugin-react-native-a11y#142
I'm by no means an a11y expert so take this for what it's worth, but Apple explicitly says,
That would suggest that hints are not always required. And as mentioned above, not all items that require labels actually support actions, so there's no result of an action you need to hint at, even if there is a need for a more explicit label (e.g. "99 comments" for an element that has a a speech bubble icon next to a number). I think it's ok for this package to be opinionated and leave this in, but it would help my team out if there was an option for it to only apply for Pressable, or maybe for any component that has an |
Agree- there seems to be a fair amount of nuance as to when For our use case, I'm thinking we can enforce the use of
Since we have the lower level |
From your documentation
"An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not apparent from the accessibility label."
Therefore, if the result is apparent from a label, and the hint is not added, the linter shouldn't flag it as an error. But hint is flagged as an error each time the label is added to an element.
An example:
<Image accessibilityLabel='Facebook logo' accessibilityRole="image" />
will give me an error - error has accessibilityLabel prop but no accessibilityHint react-native-a11y/has-accessibility-hint
But there is no other information I would want to convey for a logo... so no hint is needed.
I guess this can be improved by not including images?
The text was updated successfully, but these errors were encountered: