From a93fe0e9f06bceb6403e00a2d71f2703ce1339c2 Mon Sep 17 00:00:00 2001 From: tongsonbarbs Date: Mon, 30 Sep 2024 10:48:40 +0800 Subject: [PATCH] DataGrid - Column Header filter does not properly work if the column caption contains double quotes (T1251768) (#28107) --- .../T1251768-header-filter-double-quotes.png | Bin 0 -> 8232 bytes .../dataGrid/headerFilter/headerFilter.ts | 25 ++++++++++++++++++ .../devextreme/js/ui/shared/accessibility.js | 3 ++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 e2e/testcafe-devextreme/tests/dataGrid/headerFilter/etalons/T1251768-header-filter-double-quotes.png diff --git a/e2e/testcafe-devextreme/tests/dataGrid/headerFilter/etalons/T1251768-header-filter-double-quotes.png b/e2e/testcafe-devextreme/tests/dataGrid/headerFilter/etalons/T1251768-header-filter-double-quotes.png new file mode 100644 index 0000000000000000000000000000000000000000..17c107d1bf7b9ddf0fd93e7570fa1e197ef1ba99 GIT binary patch literal 8232 zcmeHMXIPWjwvLSG2m@F^W4Yk9*9K>f_nvdlJ?FW94^N(uexC{>;#09MTC=$|y!ASI=ZzInI{8~7~ zm5H`l-?9>wK8g8_-~M!Hl)3qpaO3z&s5Q^&A<-gL%oR&P)H z*w?TK(w+okS@9@d^zrp3c!$5QqqnVn*eof%_Tl@(CTkybuO_d32-~c-Ztc?#K3r=b z4)wt--BE8liaiKYuWyRUVK8C7jemZlnD(w;yYJE)nf0P7Ud;lbb9yjGw?J`mvD?hY z_Jz6LC~geq?7ndV7rK6hPjvdC#3$V-?S&lrGN-`f?fp~iO>y!L)Xq-Z$nO-6@^0VL z&{^VZiNoC+y&pX9(?2laUUO%^_5Gj22kKHN85xr6Fk$s+0h&~&17yaQs0xCzviJME z)75c90cgTuHl@JI(=*@b*fD}s$l^Pud*7Sr>xU)T?o$J`){o94ypED6*zfo{r;wBu zVr^+@Nn2o3V1?suA10psUU|<%UsJs8+MIg$i9Oly(ls%;nbDXNbbak>a`F!DUmo0{ z9ow@V3op3H_27gt*g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`065U!7x4GbVCo;OV|DyLKf(Nay!+2Yt8V+^ ll=nYALLT`yb>e*yEjLj?c; literal 0 HcmV?d00001 diff --git a/e2e/testcafe-devextreme/tests/dataGrid/headerFilter/headerFilter.ts b/e2e/testcafe-devextreme/tests/dataGrid/headerFilter/headerFilter.ts index f39dd302b65e..15fd2fd294f2 100644 --- a/e2e/testcafe-devextreme/tests/dataGrid/headerFilter/headerFilter.ts +++ b/e2e/testcafe-devextreme/tests/dataGrid/headerFilter/headerFilter.ts @@ -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', + ], +})); diff --git a/packages/devextreme/js/ui/shared/accessibility.js b/packages/devextreme/js/ui/shared/accessibility.js index 404c53922995..ea60e4a209a1 100644 --- a/packages/devextreme/js/ui/shared/accessibility.js +++ b/packages/devextreme/js/ui/shared/accessibility.js @@ -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]'); }