Skip to content

Announce sort state on a column header when changed with an inner button#14234

Merged
michaelDCurran merged 9 commits into
masterfrom
i10890
Oct 26, 2022
Merged

Announce sort state on a column header when changed with an inner button#14234
michaelDCurran merged 9 commits into
masterfrom
i10890

Conversation

@michaelDCurran

Copy link
Copy Markdown
Member

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

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • Security precautions taken.

…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.
@michaelDCurran michaelDCurran requested a review from a team as a code owner October 11, 2022 01:04
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 0037c02edd

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit b4c86b790b

@michaelDCurran

Copy link
Copy Markdown
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
Holding this back until this can be sorted.

Comment thread source/NVDAObjects/__init__.py Outdated
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 82a6a30ce0

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 3495f4ddc1

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit fcd4d6f714

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit fcd4d6f714

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit bcc6ac8423

@michaelDCurran michaelDCurran merged commit 93fc1ed into master Oct 26, 2022
@michaelDCurran michaelDCurran deleted the i10890 branch October 26, 2022 19:00
@nvaccessAuto nvaccessAuto added this to the 2023.1 milestone Oct 26, 2022
@brunoprietog

Copy link
Copy Markdown

I think this could also potentially fix #13316

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.

aria-sort changes not announced when the change is not on the focused element

6 participants