Usage of the "role" attribtes
Usage of the "role" attribtes
phax
Posts: 18Questions: 5Answers: 0
Hi all,
It was brought to our attention from WAI experts, that the usage of "role='grid'" for the table and "role='row'" for table rows is superflouos, because the markup is correct anyway (table and tr). So they recommend to remove it.
To the contrary, the "role=grid" attributes is supposed to impact the display of the tables on IPhones....
Do you have any opinion on this?
Thanks, Philip
This question has accepted answers - jump to:
Answers
Hi Philip,
We've actually removed the
role=row
attribute in the latest release - it was a hack workaround for VoiceOver on macOS which we had put in from discussion with Apple engineers.role=grid
we had figured would be superfluous, but also harmless and at the same time just making its role explicit (rather than leaving it implicit).What does it do to iPhones?
Allan
Hi Allan,
Thanks for the update and the pointer.
I try to figure it out and let you know. Give me some time please.
Thanks, Philip
Hi Allan,
it seems to be an outdated information that only affects IOS 7 (so IPhone up to 4).
Further information: https://www.powermapper.com/tests/screen-readers/tables/table-role-grid/
Please ignore it.
Best, Philip
Hello, all.
We have also been notified by our accessibility experts that ARIA role="grid" in a
<table>
is invalid, as well as role="row" on a<tr>
in the<thead>
. The latest version still adds these roles.FWIW, role="grid" is intended for interactive grids. There is another ARIA role of "table" that is intended for data tables. So it is not really superfluous - it actually seems to change the meaning of the tag.
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Grid_Role
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Table_Role
Thanks.
Hi,
Thanks for the note! I've removed the roles based on your suggestions. I haven't used the table role, since that seems to be for
div
tags and the like which are pretending to be a table.Allan
That you , Allan!
I'm sorry, I didn't mean to suggest that the "table" role should be added here. As you noted, it's intended for when
<div>
or other tags are used to represent<table>
tags. I was just trying to point out that using the "grid" role appeared to change the meaning of the<table>
tag.Thanks again!
I'm with you now - thanks for the clarification .
Allan