Skip to content

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

Closed
@aleavikraman

Description

@aleavikraman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions