-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Data Views] Adding aria-sort
to table view headers
#56860
Conversation
Ensures sorting semantics are not just communicated visually
@@ -545,6 +545,9 @@ function ViewTable( { | |||
// TODO:Add spinner or progress bar.. | |||
return <h3>{ __( 'Loading' ) }</h3>; | |||
} | |||
|
|||
const sortValues = { asc: 'ascending', desc: 'descending' }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know if there's a general preference for raw objects or Maps, but happy to change this as necessary...
const sortValues = { asc: 'ascending', desc: 'descending' }; | |
const sortValues = new Map([ ['asc', 'ascending'] , ['desc', 'descending'] ]); |
Size Change: +30 B (0%) Total Size: 1.72 MB
ℹ️ View Unchanged
|
Flaky tests detected in 1705e2c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7127856999
|
What?
This PR adds
aria-sort
to column headers in table view. Resolves #56853.Why?
Ensures sorting semantics are not just communicated visually
How?
Every column header gets an
aria-sort
prop with a value appropriate for the sort status of the column ("ascending"
/"descending"
/undefined
).Testing Instructions
aria-sort
on the correct<th>
, eitherascending
ordescending
as appropriate, and thataria-sort
does not appear on any other<th>
.