File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed
projects/igniteui-angular/src/lib/grids Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,27 @@ describe('IgxGrid - multi-column headers #grid', () => {
204204 }
205205 } ) ) ;
206206
207+ it ( 'The ariaHidden getter should not throw when the grid has no active node (#16517)' , fakeAsync ( ( ) => {
208+ fixture = TestBed . createComponent ( BlueWhaleGridComponent ) as ComponentFixture < BlueWhaleGridComponent > ;
209+ tick ( ) ;
210+ fixture . detectChanges ( ) ;
211+
212+ // The grid active node will be null if there is no data and the body is focused
213+ grid = fixture . componentInstance . grid ;
214+ grid . data = [ ] ;
215+
216+ tick ( ) ;
217+ fixture . detectChanges ( ) ;
218+
219+ const gridContent = GridFunctions . getGridContent ( fixture ) ;
220+
221+ expect ( ( ) => {
222+ gridContent . triggerEventHandler ( 'focus' , null ) ;
223+ tick ( 400 ) ;
224+ fixture . detectChanges ( ) ;
225+ } ) . not . toThrow ( ) ;
226+ } ) ) ;
227+
207228 it ( 'Should render dynamic column group header correctly (#12165).' , ( ) => {
208229 fixture = TestBed . createComponent ( BlueWhaleGridComponent ) as ComponentFixture < BlueWhaleGridComponent > ;
209230 ( fixture as ComponentFixture < BlueWhaleGridComponent > ) . componentInstance . firstGroupRepeats = 1 ;
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ export class IgxGridHeaderGroupComponent implements DoCheck {
151151 * @hidden
152152 */
153153 public get ariaHidden ( ) : boolean {
154- return this . grid . hasColumnGroups && ( this . column . hidden || this . grid . navigation . activeNode . row !== - 1 ) ;
154+ return this . grid . hasColumnGroups && ( this . column . hidden || this . grid . navigation . activeNode ? .row !== - 1 ) ;
155155 }
156156
157157 /**
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ export class IgxGridHeaderRowComponent implements DoCheck {
123123 * @internal
124124 */
125125 public get isLeafHeaderAriaHidden ( ) : boolean {
126- return this . grid . navigation . activeNode . row === - 1 ;
126+ return this . grid . navigation . activeNode ? .row === - 1 ;
127127 }
128128
129129 /** The virtualized part of the header row containing the unpinned header groups. */
You can’t perform that action at this time.
0 commit comments