From f645b2ffa708a9a78315e7b72d14ae8f47dcac6f Mon Sep 17 00:00:00 2001 From: Bozhidara Pachilova Date: Wed, 26 Nov 2025 11:10:13 +0200 Subject: [PATCH 1/3] test(grid-col-groups): add test for no data + focus grid body --- .../grids/grid/src/column-group.spec.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/projects/igniteui-angular/grids/grid/src/column-group.spec.ts b/projects/igniteui-angular/grids/grid/src/column-group.spec.ts index dfbbbaaaac2..8cc17811d29 100644 --- a/projects/igniteui-angular/grids/grid/src/column-group.spec.ts +++ b/projects/igniteui-angular/grids/grid/src/column-group.spec.ts @@ -203,6 +203,27 @@ describe('IgxGrid - multi-column headers #grid', () => { } })); + it('The ariaHidden getter should not throw when the grid has no active node (#16517)', fakeAsync(() => { + fixture = TestBed.createComponent(BlueWhaleGridComponent) as ComponentFixture; + tick(); + fixture.detectChanges(); + + // The grid active node will be null if there is no data and the body is focused + grid = fixture.componentInstance.grid; + grid.data = []; + + tick(); + fixture.detectChanges(); + + const gridContent = GridFunctions.getGridContent(fixture); + + expect(async () => { + gridContent.triggerEventHandler('focus', null); + await wait(400); + fixture.detectChanges(); + }).not.toThrow(); + })); + it('Should render dynamic column group header correctly (#12165).', () => { fixture = TestBed.createComponent(BlueWhaleGridComponent) as ComponentFixture; (fixture as ComponentFixture).componentInstance.firstGroupRepeats = 1; From b00dca1757a847c3569ebf49e0223fc68927cf90 Mon Sep 17 00:00:00 2001 From: Bozhidara Pachilova Date: Wed, 26 Nov 2025 11:21:02 +0200 Subject: [PATCH 2/3] fix(grid): add null check for activeNode --- .../grids/core/src/headers/grid-header-group.component.ts | 2 +- .../grids/core/src/headers/grid-header-row.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/igniteui-angular/grids/core/src/headers/grid-header-group.component.ts b/projects/igniteui-angular/grids/core/src/headers/grid-header-group.component.ts index 07595de14aa..9a5de67f9be 100644 --- a/projects/igniteui-angular/grids/core/src/headers/grid-header-group.component.ts +++ b/projects/igniteui-angular/grids/core/src/headers/grid-header-group.component.ts @@ -151,7 +151,7 @@ export class IgxGridHeaderGroupComponent implements DoCheck { * @hidden */ public get ariaHidden(): boolean { - return this.grid.hasColumnGroups && (this.column.hidden || this.grid.navigation.activeNode.row !== -1); + return this.grid.hasColumnGroups && (this.column.hidden || this.grid.navigation.activeNode?.row !== -1); } /** diff --git a/projects/igniteui-angular/grids/core/src/headers/grid-header-row.component.ts b/projects/igniteui-angular/grids/core/src/headers/grid-header-row.component.ts index 93ab924c2fd..6646a57fb4f 100644 --- a/projects/igniteui-angular/grids/core/src/headers/grid-header-row.component.ts +++ b/projects/igniteui-angular/grids/core/src/headers/grid-header-row.component.ts @@ -123,7 +123,7 @@ export class IgxGridHeaderRowComponent implements DoCheck { * @internal */ public get isLeafHeaderAriaHidden(): boolean { - return this.grid.navigation.activeNode.row === -1; + return this.grid.navigation.activeNode?.row === -1; } /** The virtualized part of the header row containing the unpinned header groups. */ From 55755e45905d194fcb293688caf43d44aa4eafc2 Mon Sep 17 00:00:00 2001 From: Bozhidara Pachilova <35433937+ddaribo@users.noreply.github.com> Date: Wed, 26 Nov 2025 11:38:18 +0200 Subject: [PATCH 3/3] Update projects/igniteui-angular/grids/grid/src/column-group.spec.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- projects/igniteui-angular/grids/grid/src/column-group.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/igniteui-angular/grids/grid/src/column-group.spec.ts b/projects/igniteui-angular/grids/grid/src/column-group.spec.ts index 8cc17811d29..232dc7f0d15 100644 --- a/projects/igniteui-angular/grids/grid/src/column-group.spec.ts +++ b/projects/igniteui-angular/grids/grid/src/column-group.spec.ts @@ -217,9 +217,9 @@ describe('IgxGrid - multi-column headers #grid', () => { const gridContent = GridFunctions.getGridContent(fixture); - expect(async () => { + expect(() => { gridContent.triggerEventHandler('focus', null); - await wait(400); + tick(400); fixture.detectChanges(); }).not.toThrow(); }));