You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EuiTableHeaderCell should read aloud text content instead of aria-label #1378
It means that providing a node as children will cause the screen reader to read something like "Sort [Object object] ascending".
As the user traverses the cells in the table body, the screen reader reads aloud the associated column header to help the user orient themselves. This means the user hears "Sort {column title} ascending/descending" for each cell they navigate to, which is confusing to hear.
I think one solution would be to use the sortIcon to provide screen-reader-specific sort information. Instead of conditionally rendering it, we could always render it but wrap it in EuiScreenReaderOnly when the column isn't being sorted on. We could then put aria-label={Click to sort ascending/descending} on the sort icon, which will be read aloud after the column text content is read.
Removing aria-label from column headers appears to be the right direction. A few things to consider after doing some research:
aria-label is currently derived from a prop (ariaLabel) that would likely no longer have a use should we rely on the cell text. Removing this prop and aria attr could be considered a breaking change.
Regardless, aria-label is likely not the correct attribute for table cells ("If the label text is visible on screen, authors SHOULD use aria-labelledby and SHOULD NOT use aria-label." -W3C).
aria-sort may provide sufficient information about table sorting state to avoid adding aria attributes the button or icon.
We likely want to add role="grid" to the parent table when columns are sortable. It's implied that the cells are non-interactive with the default role.
Taking another look, ariaLabel is of course just a pass-through HTML attribute. That being said, we'd still be removing it from the EuiTableHeaderCell API
aria-sort does not appear to be supported by VoiceOver. It's possible we'll want to do a combination of aria-sort and some kind of label on the icon decorator to be comprehensive
Activity
thompsongl commentedon Jan 10, 2019
Removing
aria-labelfrom column headers appears to be the right direction. A few things to consider after doing some research:aria-labelis currently derived from a prop (ariaLabel) that would likely no longer have a use should we rely on the cell text. Removing this prop and aria attr could be considered a breaking change.Regardless,
aria-labelis likely not the correct attribute for table cells ("If the label text is visible on screen, authors SHOULD usearia-labelledbyand SHOULD NOT usearia-label." -W3C).aria-sortmay provide sufficient information about table sorting state to avoid adding aria attributes thebuttonor icon.role="grid"to the parenttablewhen columns are sortable. It's implied that the cells are non-interactive with the defaultrole.thompsongl commentedon Jan 10, 2019
Taking another look,
ariaLabelis of course just a pass-through HTML attribute. That being said, we'd still be removing it from theEuiTableHeaderCellAPIchandlerprall commentedon Jan 10, 2019
I think taking a look at
aria-sortandrole="grid"is the right direction. Getting more alignment with the WAI-ARIA guidelines would be a good thing.thompsongl commentedon Jan 10, 2019
aria-sortdoes not appear to be supported by VoiceOver. It's possible we'll want to do a combination ofaria-sortand some kind of label on the icon decorator to be comprehensivethompsongl commentedon Jan 23, 2019
Resolved by #1426