w3c / html-aria

ARIA in HTML
https://w3c.github.io/html-aria/
Other
181 stars 48 forks source link

Allow gridcell and treeitem roles on button elements #298

Closed smhigley closed 1 year ago

smhigley commented 3 years ago

In the Rules of ARIA attribute usage by HTML element , <button> already allows every child role of composite widgets that manage focus except for tree and grid.

There are benefits in using <button> as a base of interaction in these widgets, such as:

Those benefits also apply to gridcells and treeitems, so it seems like it would be valuable to add those as well.

Happy to do a PR for this :)

scottaohara commented 3 years ago

Closing. Reasoning provided in the closed PR #299

smhigley commented 1 year ago

@scottaohara would you mind reopening, since we discussed taking a look at this again?

scottaohara commented 1 year ago

re: discussion mentioned above - the reason this was re-opened is because while HTML's content model will still disallow nested interactive elements within a button element (regardless if its role was overwritten or not), in further testing there does not appear to be any negative impact from a UX pov. Additionally, even in situations where using a base button element for these roles, or if one were to include nested interactive elements - any problems found would either be issues for all users (e.g., pressing a gridcell submits a form unexpectedly) or would likely be found via other wcag related testing (automated or manual).