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

Sortable table fails without at least one column that is not sorted #2904

Closed
MalcolmSlaney opened this issue Jan 18, 2024 · 2 comments · Fixed by #2910
Closed

Sortable table fails without at least one column that is not sorted #2904

MalcolmSlaney opened this issue Jan 18, 2024 · 2 comments · Fixed by #2910
Labels
bug Code defects; not for inaccurate prose Example Page Related to a page containing an example implementation of a pattern Feedback Issue raised by or for collecting input from people outside APG task force

Comments

@MalcolmSlaney
Copy link

Sortable table is a great example. But it seems to fail unless (at least?) one column is marked non-sortable. If everything is sortable then the top header row is shrunken in height and the active zone is very small.

Is this a known problem? Seems surprising that it hasn't been noticed before, since sorting all columns seems common.

I didn't find the issue in the issue database, which is surprising to me. I'm happy to generate an example if this is not a known problem.

-- Malcolm

@MalcolmSlaney
Copy link
Author

MalcolmSlaney commented Jan 22, 2024

Here is an example of the bug. The first table is exactly the example from the docs. The second table is just like the first, but the one non-sortable column in the original table is now sortable. '

The CSS/JS seems to fail if all the columns are sortable.

Can this be fixed? I've attached a screen capture (from Google Chrome) and the HTML code (which seems to render fine on this github page, but not in real life.)

-- Malcolm

sortable_example_bug <title>California Course Difficulties</title> <script src="https://www.w3.org/WAI/content-assets/wai-aria-practices/patterns/table/examples/js/sortable-table.js"></script> Original example from https://www.w3.org/WAI/ARIA/apg/patterns/table/examples/sortable-table/
Students currently enrolled in WAI-ARIA 101 , column headers with buttons are sortable.
First Name Last Name Company Address Favorite Number
Fred Jackson Canary, Inc. 123 Broad St. 56
Sara James Cardinal, Inc. 457 First St. 7
Ralph Jefferson Robin, Inc. 456 Main St. 513
Nancy Jensen Eagle, Inc. 2203 Logan Dr. 3.5

Version with *all* sortable columns, showing the bug. All that changed from above is that the TH for address has been turned into a button, like the other columns.

Students currently enrolled in WAI-ARIA 101 , column headers with buttons are sortable.
First Name Last Name Company Address Favorite Number
Fred Jackson Canary, Inc. 123 Broad St. 56
Sara James Cardinal, Inc. 457 First St. 7
Ralph Jefferson Robin, Inc. 456 Main St. 513
Nancy Jensen Eagle, Inc. 2203 Logan Dr. 3.5
<p>       

@css-meeting-bot
Copy link
Member

The ARIA Authoring Practices (APG) Task Force just discussed Sortable table bug.

The full IRC log of that discussion <jugglinmike> Topic: Sortable table bug
<jugglinmike> github: https://github.com//issues/2904
<jugglinmike> Matt_King: There is a pull request which addresses this
<jugglinmike> Matt_King: The issue looked pretty well-documented to me
<jugglinmike> Matt_King: They're saying that if all the columns are sortable, you end up with this problem
<jugglinmike> Matt_King: They're changing our example. Our example doesn't work if you make all the columns sortable
<jugglinmike> siri: If the column is not sorted, nothing is visually provided to the users that indicates that the column is sortable (not until I hover over it or give focus to it)
<jugglinmike> Matt_King: That was a design decision because we didn't want to clutter the table with a bunch of icons. No one does that in the real world
<jugglinmike> Matt_King: The table allows you to sort by multiple criteria, but ARIA sort doesn't support this, and so neither does the visual presentation here
<Jem> https://www.w3.org/WAI/ARIA/apg/patterns/table/examples/sortable-table/
<jugglinmike> CurtBellew: At Oracle, we do offer sortable tables where the "sort" icon is always present
<jugglinmike> CurtBellew: And here in APG, that's also available when enabling the example's option labeled "Display sort icon in headers of sortable columns that are not sorted"
<jugglinmike> Matt_King: Ah, so Siri's preferred behavior is available with this option. Siri's feedback is about changing the default behavior
<jugglinmike> CurtBellew: Oracle's implementation looks slightly different (using an "up" arrow and a "down" arrow instead of a diamond shape), but it matches Siri's expectation
<jugglinmike> Matt_King: In any case, this is a separate issue than what's been reported
<jugglinmike> Zakim, end the meeting

mcking65 pushed a commit that referenced this issue Feb 26, 2024
…sortable (pull #2910)

Fix issue #2904: Ensure that the TH height is sufficient if the table is changed to make all the columns sortable.
@mcking65 mcking65 added bug Code defects; not for inaccurate prose Example Page Related to a page containing an example implementation of a pattern Feedback Issue raised by or for collecting input from people outside APG task force labels Jul 27, 2024
@mcking65 mcking65 added this to the H1/2024 APG Improvements milestone Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Code defects; not for inaccurate prose Example Page Related to a page containing an example implementation of a pattern Feedback Issue raised by or for collecting input from people outside APG task force
3 participants