Skip to content
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

Accessibility: Overlay has invalid role option role="null" #12912

Closed
aleavikraman opened this issue Sep 27, 2023 · 1 comment · Fixed by #13051
Closed

Accessibility: Overlay has invalid role option role="null" #12912

aleavikraman opened this issue Sep 27, 2023 · 1 comment · Fixed by #13051
Labels

Comments

@aleavikraman
Copy link

I found this bug while using Macbook Ventura. When the overlay that says "use command + scroll to zoom the map" appears it creates a role="alert" when the overlay is removed it has a role="null"

"null" is not a valid role type and creates an accessibility error. I would suggest using role="none" instead, unless there is a better fitting option. You can read more about role types here

mapbox-gl-js version:
2.14.1

browser:
chrome, edge

Steps to Trigger Behavior

  1. move curser on to map and scroll up or down with mouse
  2. inspect the DOM where the class "mapboxgl-scroll-zoom-tracker" is
  3. while scrolling you can see the role change from alert to null

you can also see this by running axe devTools on a page with the map and you'll get the error "ARIA roles used must conform to valid values"

Link to Demonstration

https://docs.mapbox.com/mapbox-gl-js/example/cooperative-gestures/

Expected Behavior

role to be a valid type

Actual Behavior

role="null" an invalid type

@jakubmakielkowski
Copy link
Contributor

My PR changes remove this attribute when alert is not visible. These are scroll zoom and touch pan alerts. I could also use "none" role, but both approaches seem to look correct.
Screen reader reads it correctly and axe devtool does not show an error.
What do you think about my approach? @mourner @aleavikraman

Tested on Chrome and Firefox on Windows 10 with axe devtools and NVDA screen reader.

See PR #13051

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

Successfully merging a pull request may close this issue.

3 participants