-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Revisit implementation of accessibilityRole="button"
#1899
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
Comments
This comment has been minimized.
This comment has been minimized.
@necolas What should be the case for |
@intergalacticspacehighway what's the problem with I think that would be a useful improvement to HTML semantics. Also probably useful for SEO (not sure about that tho) |
We ran into this issue because our a11y rules require semantic HTML rather than using a11y attributes (e.g. So, we started with @intergalacticspacehighway's PR #1944 implementation, but because not everyone shares our same a11y rules and may not want to map roles to semantic HTML, we short-circuited the It brought up a question of whether react-native-web should be prescriptive in converting a11y roles to semantic HTML? There is great value in using semantic HTML, so I understand why it does today. However, that might not fit everyone's need. It would be interesting to see if there is a way for components to opt-in/out of the conversion from a11y role to semantic HTML. After all this being said and based on current react-native-web behavior to map a11y roles to semantic HTML, I think @intergalacticspacehighway's PR #1944 does what's needed to support our direct need to mapping a11y role |
Your accessibility rule requiring a semantic tag doesn't surface a functional problem for users. |
What's stopping #1944 from being merged? According to mozilla best practises regarding this issue.
|
Also this is stopping the availibity of using features like this: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share Because they need "Must be triggered some kind of "user activation"" |
No it isn't. |
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
Revisit mapping
accessibilityRole="button"
tobutton
element.The current approach uses ARIA roles to achieve similar results due to historical problems in Firefox with flexbox children of a button. But this was fixed in Firefox 63 and the current ESR version is 78, so we may be able to migrate away from this special case and map "button" to an element like we do for several other roles. (FB web still supports FF versions prior to 63 but no one performs visual tests that far back so I don't think we need to be too concerned about it.)
This shouldn't produce any savings in bytes since the code used to implement ARIA-backed buttons is also used by the unstable
createElement
API and for other ARIA roles that should have similar behavior to buttons (i.e., respond to user interaction).The text was updated successfully, but these errors were encountered: