Skip to content

Commit

Permalink
Grids a11y: Fix the header filter and the column chooser focus issue …
Browse files Browse the repository at this point in the history
…and update VPAT (#28309)
  • Loading branch information
tongsonbarbs authored Nov 6, 2024
1 parent b5171c4 commit 5804fda
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
import DataGrid from 'devextreme-testcafe-models/dataGrid';
import CommandCell from 'devextreme-testcafe-models/dataGrid/commandCell';
import { ClassNames } from 'devextreme-testcafe-models/dataGrid/classNames';
import HeaderFilter from 'devextreme-testcafe-models/dataGrid/headers/headerFilter';
import { createWidget } from '../../../helpers/createWidget';
import url from '../../../helpers/getPageUrl';
import { getData } from '../helpers/generateDataSourceData';
Expand Down Expand Up @@ -4806,3 +4807,34 @@ test('Cancel button in the last column cannot be focused via the Tab key (T12489
'FirstName',
],
}));

test('Grids a11y: Fix the header filter and the column chooser focus issue and update VPAT', async (t) => {
const dataGrid = new DataGrid('#container');
const filterIconElement = dataGrid.getHeaders().getHeaderRow(0).getHeaderCell(0).getFilterIcon();
const headerFilter = new HeaderFilter();
const columnChooser = dataGrid.getColumnChooser();
const columnChooserButton = dataGrid.getColumnChooserButton();

await t
.expect(dataGrid.isReady())
.ok()
.click(filterIconElement)
.pressKey('tab tab tab tab tab tab')
.expect(headerFilter.getButtons().nth(1).focused)
.ok()
.click(columnChooserButton)
.pressKey('tab tab tab')
.expect(columnChooser.content.focused)
.ok();
})
.before(async () => {
await createWidget('dxDataGrid', {
dataSource: getData(5, 3),
headerFilter: {
visible: true,
},
columnChooser: {
enabled: true,
},
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export class ColumnChooserView extends ColumnsView {
}
},
container: columnChooserOptions.container,
_loopFocus: true,
};

if (isGenericTheme || isMaterial) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ export class HeaderFilterView extends Modules.View {
// T321243
component.option('animation', component._getDefaultOptions().animation);
},
_loopFocus: true,
};

if (!isDefined(that._popupContainer)) {
Expand Down

0 comments on commit 5804fda

Please sign in to comment.