Skip to content

Commit 9e375c8

Browse files
Adriana IxbaDevtools-frontend LUCI CQ
authored andcommitted
[RPP a11y] Ensure column headers announce that they are sortable
Improvement follow up. Initially there were no voice over announcements that the column headers are sortable. This fixes that. Bug:392649075 Change-Id: If30c88dd59328cfcd02015e37f8c6218325102c0 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6221817 Reviewed-by: Adam Raine <[email protected]> Commit-Queue: Adriana Ixba <[email protected]>
1 parent 36c3823 commit 9e375c8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

front_end/ui/legacy/components/data_grid/DataGrid.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ const UIStrings = {
110110
*@example {ascending} PH1
111111
*/
112112
enterToSort: 'Column sort state: {PH1}. Press enter to apply sorting filter',
113+
/**
114+
*@description Label for sortable column headers.
115+
*/
116+
sortableColumn: 'Sortable column. Press enter to apply sorting filter',
113117
};
114118
const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/data_grid/DataGrid.ts', UIStrings);
115119
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -456,6 +460,10 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
456460
const icon = document.createElement('span');
457461
icon.className = 'sort-order-icon';
458462
cell.createChild('div', 'sort-order-icon-container').appendChild(icon);
463+
464+
if (column.title) {
465+
UI.ARIAUtils.setLabel(cell, i18nString(UIStrings.sortableColumn));
466+
}
459467
}
460468
}
461469

0 commit comments

Comments
 (0)