read column sorting changes aloud in Files page

fixes ADMIN-2618

test plan:
 - On Files page with screenreader, verify clicking column header
   reads a message like "Sort ascending by name"

Change-Id: Id95b9f0668069b26a39a446f8bd2cbd33afcfe8f
Reviewed-on: https://gerrit.instructure.com/203175
Tested-by: Jenkins
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Daniel Sasaki <dsasaki@instructure.com>
Product-Review: Daniel Sasaki <dsasaki@instructure.com>
This commit is contained in:
Carl Kibler 2019-07-30 15:24:15 -06:00
parent b410ebc4fe
commit 465933c132
1 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,11 @@ import ColumnHeaders from 'compiled/react_files/components/ColumnHeaders'
return;
}
var isSortedCol = sort === column.property;
if (this.props.query.sort && isSortedCol && order) {
const direction = order === 'asc' ? 'ascending' : 'descending'
$.screenReaderFlashMessage(I18n.t("Sorted %{direction} by %{columnName}",
{direction, columnName: column.displayName}))
}
var columnClassNameObj = {
"current-filter": isSortedCol
};