Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jaws should announce a header cell with aria-sort="none" as "sortable, not sorted" #879

Open
Wildebrew opened this issue Jan 13, 2025 · 0 comments

Comments

@Wildebrew
Copy link

Summary

Users need to know what columns in a table can be used to sort the table. That's why we have the aria-sort attribute.

This works very well when a sort is applied to the column (leaving aside the custom sort, which I have never really understood).

  • aria-sort="ascending" = sorted by this column in ascending order
  • aria-sort="descending" = table is sorted by this column in descending order
    This is announced as expected.

But then there is aria-sort="none".

To my mind, aria-sort="none" means that the table can be sorted by that column, but it isn't currently. This is valuable information to someone using a screen reader.

Yet screen readers (including Jaws) treat aria-sort="none" the same as having no aria-sort attribute, .e. they say nothing about it when you navigate to the header cell.

Example

(note, this is just non-functional markup):

Imagine the following markup for a 3 column table

<tr>
<th aria-sort="ascending"><button>First name</button></th>
<th aria-sort="none"><button>Last name</button></th>
<th>phone number</th>
</tr>

You can sort by first name or last name by clicking the button in the column header.
You cannot sort by phone number.

When I navigate these headers with a screen reader, I'd expect to hear:

  • First name, sorted ascending
  • Last name (sortable, not sorted)
  • Phone number

But I do hear:

  • First name, sorted ascending
  • Last name
  • Phone number

Sure, if user navigates by the tab key they'll find the buttons and can figure it out from there, but they shouldn't have to.

We could put screen reader text in that cell that says "sortable", but that text will be announced every time a user navigates to a cell in that column, that's bad user experience. Different authors will use slightly different verbiage so it's not consistent either.

Maybe the issue isn't with the screen reader, maybe the browser does not expose the sort attribute in the accessibility tree unless it's active, but then this is a browser issue.

I'm happy to file or follow up on that if that's the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant