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] Consider replacing aria-pressed with aria-expanded on the attribution control #11034

Closed
Malvoz opened this issue Sep 18, 2021 · 0 comments · Fixed by #11064
Closed
Assignees
Milestone

Comments

@Malvoz
Copy link

Malvoz commented Sep 18, 2021

Regarding:

_toggleAttribution() {
if (this._container.classList.contains('mapboxgl-compact-show')) {
this._container.classList.remove('mapboxgl-compact-show');
this._compactButton.setAttribute('aria-pressed', 'false');
} else {
this._container.classList.add('mapboxgl-compact-show');
this._compactButton.setAttribute('aria-pressed', 'true');
}
}

aria-pressed is similar to aria-expanded in that it indicates the state of the button, but aria-expanded is more appropriate as it specifically:

Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.

The distinction is that with aria-expanded the (non-visual) user will expect other ("new") content to be available after pressing the button. This is mostly important as there is no focus delegation (which is fine if it's conveyed to the user that new content is available through aria-expanded).

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

Successfully merging a pull request may close this issue.

3 participants