Skip to content

Commit 05faaa2

Browse files
committed
refactor(cell, header): use headerCell.id for aria-describedby
1 parent 693a735 commit 05faaa2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

projects/igniteui-angular/src/lib/grids/cell.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,7 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy, CellT
517517
/** @hidden @internal */
518518
@HostBinding('attr.aria-describedby')
519519
public get ariaDescribeBy() {
520-
let describeBy = this.grid.headerGroupsList
521-
.find(hg => hg.column.field === this.column.field)?.headerID || '';
520+
let describeBy = this.column.headerCell?.id || '';
522521
if (this.isInvalid) {
523522
describeBy += ' ' + this.ariaErrorMessage;
524523
}

projects/igniteui-angular/src/lib/grids/headers/grid-header.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ export class IgxGridHeaderComponent implements DoCheck, OnDestroy {
5555
@ViewChild('sortIconContainer', { read: ElementRef })
5656
protected sortIconContainer: ElementRef;
5757

58+
/**
59+
* @hidden
60+
*/
61+
@Input()
62+
@HostBinding('attr.id')
63+
public id: string;
64+
5865
/**
5966
* Returns the `aria-selected` of the header.
6067
*/

0 commit comments

Comments
 (0)