@@ -1808,6 +1808,15 @@ export abstract class IgxGridBaseDirective implements GridType,
1808
1808
@HostBinding ( 'class.igx-grid' )
1809
1809
protected baseClass = 'igx-grid' ;
1810
1810
1811
+ @HostBinding ( 'attr.aria-colcount' )
1812
+ protected get ariaColCount ( ) : number {
1813
+ return this . visibleColumns . length ;
1814
+ }
1815
+
1816
+ @HostBinding ( 'attr.aria-rowcount' )
1817
+ protected get ariaRowCount ( ) : number {
1818
+ return this . _rendered ? this . _rowCount : null ;
1819
+ }
1811
1820
1812
1821
/**
1813
1822
* Gets/Sets the resource strings.
@@ -2734,13 +2743,10 @@ export abstract class IgxGridBaseDirective implements GridType,
2734
2743
public get activeDescendant ( ) {
2735
2744
const activeElem = this . navigation . activeNode ;
2736
2745
2737
- if ( ! activeElem || ! Object . keys ( activeElem ) . length ) {
2738
- return this . id ;
2746
+ if ( ! activeElem || ! Object . keys ( activeElem ) . length || activeElem . row < 0 ) {
2747
+ return null ;
2739
2748
}
2740
-
2741
- return activeElem . row < 0 ?
2742
- `${ this . id } _${ activeElem . row } _${ activeElem . mchCache . level } _${ activeElem . column } ` :
2743
- `${ this . id } _${ activeElem . row } _${ activeElem . column } ` ;
2749
+ return `${ this . id } _${ activeElem . row } _${ activeElem . column } ` ;
2744
2750
}
2745
2751
2746
2752
/** @hidden @internal */
@@ -3269,6 +3275,7 @@ export abstract class IgxGridBaseDirective implements GridType,
3269
3275
private _sortDescendingHeaderIconTemplate : TemplateRef < IgxGridHeaderTemplateContext > = null ;
3270
3276
private _gridSize : Size = Size . Large ;
3271
3277
private _defaultRowHeight = 50 ;
3278
+ private _rowCount : number ;
3272
3279
3273
3280
/**
3274
3281
* @hidden @internal
@@ -4090,6 +4097,7 @@ export abstract class IgxGridBaseDirective implements GridType,
4090
4097
if ( this . hasColumnsToAutosize ) {
4091
4098
this . autoSizeColumnsInView ( ) ;
4092
4099
}
4100
+ this . _calculateRowCount ( ) ;
4093
4101
this . _rendered = true ;
4094
4102
} ) ;
4095
4103
Promise . resolve ( ) . then ( ( ) => this . rendered . next ( true ) ) ;
@@ -6732,6 +6740,7 @@ export abstract class IgxGridBaseDirective implements GridType,
6732
6740
6733
6741
this . initColumns ( this . _columns , ( col : IgxColumnComponent ) => this . columnInit . emit ( col ) ) ;
6734
6742
this . columnListDiffer . diff ( this . columnList ) ;
6743
+ this . _calculateRowCount ( ) ;
6735
6744
6736
6745
this . columnList . changes
6737
6746
. pipe ( takeUntil ( this . destroy$ ) )
@@ -7955,4 +7964,15 @@ export abstract class IgxGridBaseDirective implements GridType,
7955
7964
return recreateTreeFromFields ( value , this . _columns ) as IFilteringExpressionsTree ;
7956
7965
}
7957
7966
}
7967
+
7968
+ private _calculateRowCount ( ) : void {
7969
+ if ( this . verticalScrollContainer ?. isRemote ) {
7970
+ this . _rowCount = this . verticalScrollContainer . totalItemCount ?? 0 ;
7971
+ } else if ( this . paginator ) {
7972
+ this . _rowCount = this . totalRecords ?? 0 ;
7973
+ } else {
7974
+ this . _rowCount = this . verticalScrollContainer ?. igxForOf ?. length ?? 0 ;
7975
+ }
7976
+ this . _rowCount += 1 ; // include header row
7977
+ }
7958
7978
}
0 commit comments