nvda
93fc1edf - Announce sort state on a column header when changed with an inner button (#14234)

Commit
3 years ago
Announce sort state on a column header when changed with an inner button (#14234) 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.
Parents
Loading