Skip to content

Commit

Permalink
DataGrid - Column Header filter does not properly work if the column …
Browse files Browse the repository at this point in the history
…caption contains double quotes (T1251768) (#28120)
  • Loading branch information
tongsonbarbs authored Sep 30, 2024
1 parent 663a1e6 commit fb98542
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/devextreme/js/ui/shared/accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ function getActiveAccessibleElements(ariaLabel, viewElement) {
let $activeElements;

if(ariaLabel) {
$activeElements = $viewElement.find(`[aria-label="${ariaLabel}"][tabindex]`);
const escapedAriaLabel = ariaLabel?.replace(/"/g, '\\"');
$activeElements = $viewElement.find(`[aria-label="${escapedAriaLabel}"][tabindex]`);
} else {
$activeElements = $viewElement.find('[tabindex]');
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,28 @@ test('Header filter should support string height and width', async (t) => {
width: '330px',
},
}));

test('DataGrid - Column Header filter does not properly work if the column caption contains double quotes (T1251768)', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const dataGrid = new DataGrid(GRID_CONTAINER);
const filterIconElement = dataGrid.getHeaders().getHeaderRow(0).getHeaderCell(0).getFilterIcon();

await t
.click(filterIconElement)
.expect(await takeScreenshot('T1251768-header-filter-double-quotes.png', dataGrid.element))
.ok()
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => createWidget('dxDataGrid', {
dataSource: getData(5, 1),
headerFilter: {
visible: true,
},
columns: [
{
dataField: 'Position',
caption: '"סה"כ שולם"',
},
'FirstName',
],
}));

0 comments on commit fb98542

Please sign in to comment.