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

feat(core/sortable-table): sortable tables #3812

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

sidvishnoi
Copy link
Member

@sidvishnoi sidvishnoi commented Oct 7, 2021

Closes https://github.com/w3c/respec/issues/3483

First attempt at sortable tables.

  • Need to check for accessibility (announcements and relations that is. keyboard works ok thanks to <button>)
  • Only supports ascending/descending and once sorted, cannot revert back.
  • Check that it covers required use cases (works well for simple tables - haven't tested for colgroup, multiple tbody etc.)
  • UI can be improved.

Live demo (check the last table).

@marcoscaceres
Copy link
Contributor

The CORS rules got changed on w3.org, which is why historyURI is failing.

Copy link
Contributor

@marcoscaceres marcoscaceres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking pretty good. it's nice that it's so small.

@xfq
Copy link
Contributor

xfq commented Nov 4, 2021

I haven't had the time to look at the implementation yet, but I wonder if it can sort non-ASCII text as well? There are some functions available in JavaScript for sorting international strings, such as Intl.Collator and localeCompare.

One use case is this: w3c/jlreq#93

See also https://www.w3.org/TR/charmod/#sec-CollationUnits

@sidvishnoi
Copy link
Member Author

Some notes for accessibility: https://adrianroselli.com/2021/04/sortable-table-columns.html

@marcoscaceres
Copy link
Contributor

useful stuff there!

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

Successfully merging this pull request may close these issues.

Make table rows sortable
4 participants