File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
projects/igniteui-angular/src/lib/grids Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ export class IgxGridNavigationService {
172
172
173
173
focusTbody ( event ) {
174
174
const gridRows = this . grid . verticalScrollContainer . totalItemCount ?? this . grid . dataView . length ;
175
+ if ( gridRows < 1 ) { this . activeNode = null ; return ; }
175
176
if ( ! this . activeNode || this . activeNode . row < 0 || this . activeNode . row > gridRows - 1 ) {
176
177
this . activeNode = { row : 0 , column : 0 } ;
177
178
this . grid . navigateTo ( 0 , 0 , ( obj ) => {
@@ -182,7 +183,8 @@ export class IgxGridNavigationService {
182
183
}
183
184
184
185
focusFirstCell ( header = true ) {
185
- if ( this . activeNode && ( this . activeNode . row === - 1 || this . activeNode . row === this . grid . dataView . length ) ) { return ; }
186
+ if ( this . grid . dataView . length && this . activeNode &&
187
+ ( this . activeNode . row === - 1 || this . activeNode . row === this . grid . dataView . length ) ) { return ; }
186
188
this . activeNode = { row : header ? - 1 : this . grid . dataView . length , column : 0 ,
187
189
level : this . grid . hasColumnLayouts ? 1 : 0 , mchCache : { level : 0 , visibleIndex : 0 } } ;
188
190
this . performHorizontalScrollToCell ( 0 ) ;
You can’t perform that action at this time.
0 commit comments