mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
94.05k stars 32.32k forks source link

Togglebutton does not follow WAI-ARIA toolbar keyboard navigation principles #17281

Open MarcusMorba opened 5 years ago

MarcusMorba commented 5 years ago

Togglebuttons do not follow WAI-ARIA toolbar keyboard navigation principles.

Current Behavior 😯

Navigation works only via (Shift +) TAB key. https://material-ui.com/components/toggle-button/

Expected Behavior 🤔

Navigation should be possible with arrow keys, home, end ... See https://www.w3.org/TR/wai-aria-practices/examples/toolbar/toolbar.html

oliviertassinari commented 5 years ago

Related to #15597.

We also miss the aria-pressed attribute (easy to solve).

eps1lon commented 5 years ago

Togglebutton does not follow WAI-ARIA toolbar keyboard navigation principles

Why should the togglebutton implement toolbar navigation? Those are different UI patterns.

MarcusMorba commented 5 years ago

Cause if its not a single toggle button, its a group and that is by definition a "toolbar" IMO: "A toolbar is a container for grouping a set of controls, such as buttons, menubuttons, or checkboxes."

Especially the shown examples.

eps1lon commented 5 years ago

Sure a group of togglebuttons can be a toolbar. But a toolbar isn't just a group of tooglebuttons. A toolbar can also include menu, buttons, textfields etc.

Which shifts the issue from a bug to a feature request: How to implement a toolbar of different controls from Material-UI.

mbrookes commented 5 years ago

How to implement a toolbar of different controls from Material-UI.

With the Toolbar? 🙂

MarcusMorba commented 5 years ago

Have not found a similar code example for this in the material docs, but in Google Docs they use a toolbar. image

MarcusMorba commented 5 years ago

Of course a toolbar could also be a component on its own, as @eps1lon mentioned. Then this is a feature request.

simshaun commented 5 years ago

Related: #17203