Skip to content

Commit 1edd7c1

Browse files
authored
Merge pull request #17269 from IgniteUI/mkirova/fix-17258-21.2.x
fix(igxGrid): In case zone is already stable emit detect and emit chu…
1 parent 7947732 commit 1edd7c1

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7767,12 +7767,18 @@ export abstract class IgxGridBaseDirective implements GridType,
77677767
this.verticalScrollContainer.onScroll(event);
77687768
this.disableTransitions = true;
77697769

7770-
this.zone.onStable.pipe(first()).subscribe(() => {
7770+
const callback = () => {
77717771
this.verticalScrollContainer.chunkLoad.emit(this.verticalScrollContainer.state);
77727772
if (this.rowEditable) {
77737773
this.changeRowEditingOverlayStateOnScroll(this.crudService.rowInEditMode);
77747774
}
7775-
});
7775+
};
7776+
if (this.isZonelessChangeDetection()) {
7777+
this.cdr.detectChanges();
7778+
callback();
7779+
} else {
7780+
this.zone.onStable.pipe(first()).subscribe(callback);
7781+
}
77767782
this.disableTransitions = false;
77777783

77787784
this.hideOverlays();
@@ -7797,6 +7803,10 @@ export abstract class IgxGridBaseDirective implements GridType,
77977803
this.gridScroll.emit(args);
77987804
}
77997805

7806+
protected isZonelessChangeDetection(): boolean {
7807+
return this.zone.constructor.name === 'NoopNgZone';
7808+
}
7809+
78007810
protected hasMenuPinningActions(): boolean {
78017811
const strip = this.actionStrip;
78027812
const actionButtons = strip?.actionButtons;

0 commit comments

Comments
 (0)