Skip to content

Commit 963dccf

Browse files
Adriana IxbaDevtools-frontend LUCI CQ
authored andcommitted
[RPP] Alert state of sortable column state for 3P table
Bug:392649075 Change-Id: I541b7de6ac444c36081643441d5c7e537a19ab07 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6220266 Commit-Queue: Adriana Ixba <[email protected]> Reviewed-by: Adam Raine <[email protected]>
1 parent 7d43eb4 commit 963dccf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ const UIStrings = {
105105
*@description Accessible text indicating an empty row is created.
106106
*/
107107
emptyRowCreated: 'An empty table row has been created. You may double click or use context menu to edit.',
108+
/**
109+
*@description Text for screen reader to announce when focusing on a sortable column in data grid.
110+
*@example {ascending} PH1
111+
*/
112+
enterToSort: 'Column sort state: {PH1}. Press enter to apply sorting filter',
108113
};
109114
const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/data_grid/DataGrid.ts', UIStrings);
110115
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -1317,6 +1322,7 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
13171322
cell.classList.add(sortOrder);
13181323
const ariaLabel = this.isSortOrderAscending() ? 'ascending' : 'descending';
13191324
cell.setAttribute('aria-sort', ariaLabel);
1325+
UI.ARIAUtils.alert(i18nString(UIStrings.enterToSort, {PH1: ariaLabel || ''}));
13201326

13211327
this.dispatchEventToListeners(Events.SORTING_CHANGED);
13221328
}

0 commit comments

Comments
 (0)