Skip to content

Commit f017a1d

Browse files
authored
Merge pull request #6389 from IgniteUI/mdragnev/fix-6356-master
fix(igxGrid): Detect changes when restoring virtual state #6356
2 parents 401f286 + 86fb33d commit f017a1d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5984,6 +5984,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
59845984
const actualScrollLeft = left + rowForOf.getColumnScrollLeft(rowForOf.state.startIndex);
59855985
if (gridScrLeft !== actualScrollLeft) {
59865986
rowForOf.onHScroll(gridScrLeft);
5987+
rowForOf.cdr.detectChanges();
59875988
}
59885989
}
59895990

projects/igniteui-angular/src/lib/grids/grid-navigation.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Injectable } from '@angular/core';
2-
import { first } from 'rxjs/operators';
2+
import { first, debounceTime } from 'rxjs/operators';
33
import { IgxColumnComponent } from './columns/column.component';
44
import { IgxGridGroupByRowComponent } from './grid/groupby-row.component';
55
import { ISelectionNode } from './selection/selection.service';
@@ -262,7 +262,7 @@ export class IgxGridNavigationService {
262262
this.getFocusableGrid().nativeElement.focus({ preventScroll: true });
263263
this.grid.verticalScrollContainer.scrollTo(targetIndex !== -1 ? targetIndex : 0);
264264
this.grid.verticalScrollContainer.onChunkLoad
265-
.pipe(first()).subscribe(() => {
265+
.pipe(debounceTime(10)).pipe(first()).subscribe(() => {
266266
const cells = this.grid.nativeElement.querySelectorAll(
267267
`${cellSelector}[data-visibleIndex="${visibleColumnIndex}"]`);
268268
if (cells.length > 0) { (cells[0] as HTMLElement).focus(); }
@@ -299,7 +299,7 @@ export class IgxGridNavigationService {
299299
this.getFocusableGrid().nativeElement.focus({ preventScroll: true });
300300
this.grid.verticalScrollContainer.scrollTo(targetIndex !== -1 ? targetIndex : this.grid.dataView.length - 1);
301301
this.grid.verticalScrollContainer.onChunkLoad
302-
.pipe(first()).subscribe(() => {
302+
.pipe(debounceTime(10)).pipe(first()).subscribe(() => {
303303
const cells = this.grid.nativeElement.querySelectorAll(
304304
`${cellSelector}[data-visibleIndex="${visibleColumnIndex}"]`);
305305
if (cells.length > 0) {

0 commit comments

Comments
 (0)