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] Attribution container should not have role="list" (or should have listitem children) #11033

Closed
Malvoz opened this issue Sep 18, 2021 · 8 comments
Assignees
Milestone

Comments

@Malvoz
Copy link

Malvoz commented Sep 18, 2021

this._innerContainer.setAttribute('role', 'list');

The attribution links should either be children of list items (role="listitem") or role="list" should be removed.

See motivation in https://dequeuniversity.com/rules/axe/4.2/list?application=RuleDescription (describes <ul> and <li> requirements, the same is applicable to the equivalent ARIA roles list and listitem).

@avpeery
Copy link
Contributor

avpeery commented Oct 12, 2021

Hi @Malvoz, thanks so much for your time! It seems to me that this specific accessibility issue is already set up correctly. Please correct me if I am misunderstanding. The role='list' attribute is set on the attribution container as a whole. When I go to inspect (on Chrome and Safari), the attribution links have the role listitem. Here are two screenshots from inspecting the attribution container element.
Screen Shot 2021-10-12 at 10 11 19 AM
.
Screen Shot 2021-10-12 at 10 10 13 AM

@avpeery avpeery removed a link to a pull request Oct 12, 2021
5 tasks
@Malvoz
Copy link
Author

Malvoz commented Oct 12, 2021

the attribution links have the role listitem

I actually don't recall seeing any role="listitem" children. Anyhow, overriding the implicit role="link" of <a> elements is problematic, as they're then announced as list items instead of links, so a user that relies on a screen reader wouldn't know that they are links.

It should rather be:
role="list" / <ul>
    role="listitem" / <li>
       <a>

Alternatively don't use a list (the benefit of using a list is that screen readers will announce the number of list items in the list).

@Catalyst497
Copy link

I'm interested in solving the little issue here. Could you assign it to me?
Please what file(s) am I going to be looking for here?

I am a first timer by the way.

@mrwweb
Copy link

mrwweb commented Apr 5, 2023

It would be great to get this resolved! Noted accessibility expert @marcysutton caught this issue in a recent video review of a site using Mapbox.

As @Malvoz notes, overriding the default semantics of a link is a bad idea, and it doesn't seem like these really need to be in a list. (If they did, you could also put them in a real list!)

Looking at this Mapbox demo, I could not find anything with role="list", so I'd recommend just removing role="listitem".

If @Catalyst497 is still willing, maybe someone could assign them this task and fix this!?

@kumilange
Copy link
Contributor

kumilange commented Aug 18, 2023

@mrwweb @Catalyst497 @Malvoz
I'd be happy to take over this task!
I see both role="list" in the container and role="listitem" in the links in Attribution with the latest version(v2.15.0).
v2 15 0

1. Remove role="list"
We can remove it from attribution_control.js

2. Remove role="listitem"
The link elements seem to be provided by TileJSON and I'm not sure how to fix it on my end... this might be something to be handled by someone in the Mapbox team?
attibution style server data
@tristen (seems like you worked on this PR) (cc: @stepankuzmin)
Would you be able to handle this?

As a quick fix, I can just remove role="listitem" in attribution_control.js but I understand that's not an ideal solution.


I made a draft PR based on the quick fix suggestion for now.
Kindly let me know how you'd like to go about this! 🙏🏻

@tristen
Copy link
Member

tristen commented Aug 19, 2023

Would you be able to handle this?

👋 @kumiko-haraguchi Thanks for the ping. I can handle those attributes in the TileJSON documents. Want to simplify that draft PR and assign a review from me?

@kumilange
Copy link
Contributor

Hi @tristen 👋
Thank you so much for your help! Unfortunately, I don't seem to have permission to add a reviewer for my PR. But please feel free to edit it🙏

Screenshot 2023-08-19 at 11 44 16

@Malvoz
Copy link
Author

Malvoz commented Aug 6, 2024

Fixed in #12857.

@Malvoz Malvoz closed this as completed Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants