Skip to content

[accessibility] Make the gps-alert available to screen readers #24

@Malvoz

Description

@Malvoz

Making the .gps-alert a live region is important as it conveys to screen readers that the content should be announced when added to the DOM, or otherwise has been updated. This is done by adding the status role (a live region role) to the <div>, and accompanying ARIA attributes:

<div class="gps-alert" style="display: block;"
+ role="status"
+ aria-live="polite"
+ aria-atomic="true">
  Geolocation error: User denied Geolocation.
</div>

While role="status" already implies aria-live="polite", it's best to be explicit with the value per MDN advice:

To maximize compatibility, add a redundant aria-live="polite" when using this role.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions