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

aria-sort should be allowed on multiple columns #283

Open
jnurthen opened this issue Mar 4, 2016 · 13 comments
Open

aria-sort should be allowed on multiple columns #283

jnurthen opened this issue Mar 4, 2016 · 13 comments
Assignees
Labels
feature may add new concept(s) to ARIA which will require implementations or APG changes
Milestone

Comments

@jnurthen
Copy link
Member

jnurthen commented Mar 4, 2016

aria-sort states
"For each table or grid, authors should apply aria-sort to only one header at a time."

It is relatively common in large tables to allow multiple columns to be used in the sort criteria.
Sort by column 1 then sort by column 2 etc.
We should be able to use aria-sort for this.

@ZoeBijl ZoeBijl added ARIA 1.1 and removed ARIA 1.1 labels Mar 4, 2016
@michael-n-cooper michael-n-cooper modified the milestone: ARIA 2.0 ED Nov 3, 2016
@hartman
Copy link

hartman commented Jun 29, 2017

See also: #582

@jnurthen jnurthen removed ARIA labels Jan 9, 2019
@jnurthen jnurthen added this to Needs triage in Table and Grids Mar 19, 2020
@joanmarie
Copy link
Contributor

Adding the "Agenda" label: I don't think this needs to be an ARIA 2.0 thing. Tables exist in the wild that have this functionality, and I don't believe it would be hard to support this in ATs or browsers.

@jnurthen jnurthen modified the milestones: ARIA 2.0, ARIA 1.3 Aug 13, 2020
@cookiecrook
Copy link
Contributor

cookiecrook commented Aug 13, 2020

@jnurthen found an example that uses shift-click to sort multiple columns: https://datatables.net/examples/basic_init/multi_col_sort.html

screen shot of data table header row with multiple chevrons indication multi-column sort

I don't think this is a particularly clear user interface—Of the sorted columns, which has priority?—but since it's being used in sites, I see no issue with allowing aria-sort on multiple elements.

@cookiecrook
Copy link
Contributor

cookiecrook commented Aug 13, 2020

Quick brainstorm: the "multi-column sort order/priority" problem might be solved as a new attribute aria-sortorder: null | 1 | 2 | n… or as a variant value on the existing attr, maybe: aria-sort="ascending second" or aria-sort="ascending 2"... Musing. Not thoroughly considered and no strong preference.

@JAWS-test
Copy link
Contributor

I don't think this is a particularly clear user interface—Of the sorted columns, which has priority?

In the applications I know, this is very clearly marked with numbers in the column headings

new attribute aria-sortorder or as a variant value on the existing attr, maybe: aria-sort="ascending second"

I would prefer the new attribute because the second variant differs greatly from the current ARIA standard (one attribute for two different value types: name and number)

@cookiecrook
Copy link
Contributor

cookiecrook commented Aug 25, 2020

In the applications I know, this is very clearly marked with numbers in the column headings

Screen shots and/or more specific references to those may help. I don't think I've ever seen any, and no one else on the call could think of examples that conveyed the order.

@jnurthen jnurthen removed the Agenda label Aug 26, 2020
@JAWS-test
Copy link
Contributor

Screen shots and/or more specific references to those may help

I am not allowed to publish screenshots of internal company applications, but a google search for "table multiple sort" finds many examples, e.g. https://blog.ofanitguy.com/2014/03/06/ls2013-html-enhancing-table-control-with-column-sort-and-filters/

@stes-acc
Copy link

As a matter of fact, multiple sorts in tables are not rare in real life business applications.

@jnurthen jnurthen removed the ARIA 2.0 label Mar 1, 2021
@jnurthen
Copy link
Member Author

jnurthen commented Mar 1, 2021

@stes-acc do you want to take ownership of this?

@stes-acc
Copy link

stes-acc commented Mar 2, 2021

Yes

@aardrian
Copy link
Contributor

I have a prototype of a table where more than one column can be sorted at a time. I have multiple clients whose data tables do this. I cannot share the client examples, but I can share the prototype, variants of which are in user-facing sites:

Visually, it puts numbers on the column headings to indicate which column is sorted first, and then next, and so on.

Programmatically, since there is no way to indicate a ranking or priority, I append "priority #" to the accDesc for the column. It is a bit wordy, but seems to have so far gotten the point across.

In the attached screen shot, I am showing the Year column is sorted descended, and then Title is sorted ascending, and then Author is sorted descending.

On sort in this case, the live region announced (Year was already apparent from the control name): "sorted down, Author descending priority 3, Title ascending priority 2"

For the programmatic bits once it is in the state shown in the image:

  • The accName of the Year column is "Year".
  • Its accDesc is "sort priority 1"
  • The button's accName is "Year".
  • The button has no accDesc.
  • This pattern applies to the other columns.

A table of 6 columns with the first three columns sorted; the column headers of those three include an offset circle with a number and arrows either pointing up or down.

I am not saying this is the right way to handle it. It does show a representation of what is in the wild and identifies gaps in how it should convey ranking/priority.

@AllanJard
Copy link

Just a quick note as a library author to say that aria-sortorder would be easy to implement. I'm happy to prototype things in development versions of DataTables if any accessibility software devs are interested in trying things out.

@pkra
Copy link
Member

pkra commented May 13, 2024

@aardrian would you want to take this on by any chance?

pkra pushed a commit that referenced this issue May 20, 2024
pkra pushed a commit that referenced this issue May 20, 2024
…name from content (#283)

Text level elements are not mapped to ARIA roles, but ARIA name computation alg strictly defines roles which allow name from content; also the behavior doens't match implementations

Co-authored-by: Scott O'Hara <scottaohara@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature may add new concept(s) to ARIA which will require implementations or APG changes
Projects
ARIA 1.3
Stefan
Table and Grids
  
Needs triage
Development

No branches or pull requests