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

ARIA accessibility error in Lighthouse #4435

Closed
jaro-io opened this issue Apr 12, 2021 · 4 comments
Closed

ARIA accessibility error in Lighthouse #4435

jaro-io opened this issue Apr 12, 2021 · 4 comments

Comments

@jaro-io
Copy link

jaro-io commented Apr 12, 2021

Hey there 🌳 🌻
by default swiper gives the wrapper element a role="list" and all of its children slides a role="group". Based on what Lighthouse says, this is not how its supposed to be done. A role="list" element should contain at least one children with role="listitem". Please have a look at the ARIA documentation.


Screenshot 2021-04-12 at 19 33 06


Would be super lovely if this would be changed. Or am I missing something here?

Thank you @nolimits4web!
🙏🏻

@nolimits4web
Copy link
Owner

nolimits4web commented Apr 16, 2021

by default swiper gives the wrapper element a role="list"

not sure where did you find it, but Swiper doesn't set any roles to wrapper

@jaro-io
Copy link
Author

jaro-io commented Apr 19, 2021

hey @nolimits4web!
thanks for getting back to me. my bad, sorry for the confusion. the role="list" was coming from another source. but could it be that by default, swiper gives all slides a role="group" attribute? if so, it would be super cool to be able to change that!

because in my case, my wrapper already has the role="list" attribute. and my slides already have the role="listitem" attribute. but when initialising swiper, the slides roles get overwritten by role="group". and this messes up lighthouse.

thank you for standing by!
🙏🏻

@geekysaurabh001
Copy link

Is there any way to allow the role="tabpanel" to the wrapper? ARIA is giving the warning as I have tabs present but since I cannot control the wrapper, I cannot give it the tabpanel role.

@DenyEs
Copy link

DenyEs commented Apr 22, 2024

Has this been resolved yet? I am getting the same error flagging role="group" on all swiper-slide elements. Setting slideRole in Javascript does nothing at all.

Apologies for that, I was setting it incorrectly! Below did the trick

a11y: {
        slideRole: 'link',
}

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

No branches or pull requests

4 participants