Announce sort state on a column header when changed with an inner button#14234
Merged
Conversation
…t only for the focus, but also the focus ancestors. this allows supporting scenarios such as a button inside a column header that changes the sort state.
seanbudd
approved these changes
Oct 11, 2022
See test results for failed build of commit 0037c02edd |
See test results for failed build of commit b4c86b790b |
Member
Author
|
System test currently fails every time not being able to locate the start marker. Possibly due to timing. May be fixed by #14054 |
LeonarddeR
reviewed
Oct 12, 2022
See test results for failed build of commit 82a6a30ce0 |
See test results for failed build of commit 3495f4ddc1 |
See test results for failed build of commit fcd4d6f714 |
See test results for failed build of commit fcd4d6f714 |
See test results for failed build of commit bcc6ac8423 |
Co-authored-by: Leonard de Ruijter <[email protected]>
|
I think this could also potentially fix #13316 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes #10890
Summary of the issue:
A recommended UI pattern for sortable columns in HTML tables is to embed a button inside each table column header which when pressed sorts the rows by that column and updates aria-sort on the column header.
Although it is possible to have the sorting state of the column reported manually in NVDA, NVDA does not automatically announce the sorting state when it changes.
this is because NVDA currently only announces state changes for the focused object, which in this case is the bembedded button. Where as the column header is an ancestor of the focus.
Description of user facing changes
NVDA will announce the sort state as it changes.
More broadly, NVDA will now announce any state change on a focus ancestor, not just the focus itself. For example, this could be announcing the expand collapse state on a parent when an inner focused button is pressed.
Description of development approach
Base NVDAObject's event_stateChange method: announce the new state not only if this object is the focused object, but also if this object is one of the focus ancestors.
Testing strategy:
Performed steps in #10890.
Added specific w3c datagrid ARIA example as a system test.
Known issues with pull request:
None known.
Change log entries:
New features
Changes
Bug fixes
For Developers
Code Review Checklist: