patternfly / patternfly-elements

PatternFly Elements. A set of community-created web components based on PatternFly design.
https://patternflyelements.org/
MIT License
375 stars 89 forks source link

`<pf-switch>`: Missing required aria attribute #2697

Closed kylebuch8 closed 3 months ago

kylebuch8 commented 4 months ago

Description of the issue

The pf-switch is missing the required aria-checked attribute. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/checkbox_role

Impacted component(s)

Steps to reproduce

Expected behavior

There should be an aria-checked attribute present indicating the state of the switch since the switch has a role of checkbox.

Screenshots

image

nikkimk commented 4 months ago

@bennypowers element internals aren't showing up in the accessibility tree for pf-switch and pf-jump-links

kylebuch8 commented 4 months ago

Should the role of pf-switch be role="switch"? (Thanks @bexter89)

Would it also need the title attribute?

bennypowers commented 4 months ago

@nikkimk either it's our fault and internals controller is broken, or it's the browser, or it's a polyfill bug. we should first see if there's a new version of the polyfill. then we should try it on various browsers with the polyfill NOT included and see if that helps.

We should also try this with internals controller, since switch was written before the controller was.

worst case is that browsers aren't exposing this info to AT, in which case there's not much to be done about it other than throw up our hands and sprout attrs.

bennypowers commented 3 months ago

should be closed by #2702