Skip to content

Commit 409b928

Browse files
author
Alyar
committed
Fix copilot comments
1 parent e39fbd4 commit 409b928

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/devextreme/js/__internal/grids/data_grid/summary/m_summary.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ export const renderSummaryCell = function (cell, options, setAria) {
4444
const $summaryItems: any = [];
4545

4646
if (!column.command && summaryItems) {
47-
for (let i = 0; i < summaryItems.length; i++) {
48-
const summaryItem = summaryItems[i];
47+
for (const summaryItem of summaryItems) {
4948
const text = gridCore.getSummaryText(summaryItem, options.summaryTexts);
5049
const $summaryItemElement = $('<div>')
5150
.css('textAlign', summaryItem.alignment || column.alignment)
@@ -55,7 +54,7 @@ export const renderSummaryCell = function (cell, options, setAria) {
5554
.toggleClass(DATAGRID_GROUP_TEXT_CONTENT_CLASS, options.rowType === 'group')
5655
.text(text);
5756

58-
setAria('label', `${column.caption} ${text}`, $summaryItemElement);
57+
setAria('label', `${column.caption ?? ''} ${text ?? ''}`, $summaryItemElement);
5958
$summaryItems.push($summaryItemElement);
6059
}
6160
$cell.append($summaryItems);

packages/devextreme/js/__internal/grids/grid_core/m_modules.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ export class ModuleItem {
150150
value: string | number | boolean | undefined,
151151
$target: dxElementWrapper,
152152
) {
153+
if (!isDefined(value)) {
154+
return;
155+
}
156+
153157
const target = $target.get(0);
154158
const prefix = name !== 'role' && name !== 'id' ? 'aria-' : '';
155159
const normalizedValue = String(value).replace(/\s+/g, ' ').trim();

0 commit comments

Comments
 (0)