Usage of the "role" attribtes

Usage of the "role" attribtes

phaxphax Posts: 8Questions: 1Answers: 0
edited May 18 in DataTables 1.10

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 an accepted answers - jump to answer

Answers

  • allanallan Posts: 54,542Questions: 1Answers: 8,528 Site admin
    Answer ✓

    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

  • phaxphax Posts: 8Questions: 1Answers: 0

    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

  • phaxphax Posts: 8Questions: 1Answers: 0
    edited June 1

    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

  • pa_jkeyserpa_jkeyser Posts: 2Questions: 0Answers: 0
    edited July 24

    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.

  • allanallan Posts: 54,542Questions: 1Answers: 8,528 Site admin

    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

  • pa_jkeyserpa_jkeyser Posts: 2Questions: 0Answers: 0
    edited July 26

    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!

  • allanallan Posts: 54,542Questions: 1Answers: 8,528 Site admin

    I'm with you now - thanks for the clarification :).

    Allan

Sign In or Register to comment.