Skip to content

Commit

Permalink
Merge pull request #3277 from IgniteUI/SAndreeva/fix-bug-2792-7.0.x
Browse files Browse the repository at this point in the history
fix(grid): mark grid for check inside NgZone when resizing #2792
  • Loading branch information
zdrawku authored Dec 7, 2018
2 parents 41b4f50 + 70f9be3 commit f200ac9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injectable } from '@angular/core';
import { Injectable, NgZone } from '@angular/core';
import { isFirefox } from '../core/utils';
import { IgxColumnComponent } from './column.component';

Expand Down Expand Up @@ -37,6 +37,8 @@ export class IgxColumnResizingService {
*/
public column: IgxColumnComponent;

constructor(private zone: NgZone) { }


/**
* Returns the minimal possible width to which the column can be resized.
Expand Down Expand Up @@ -104,7 +106,8 @@ export class IgxColumnResizingService {
this.column.width = size;
}

this.column.grid.markForCheck();
this.zone.run(() => {});

this.column.grid.reflow();
this.column.grid.onColumnResized.emit({
column: this.column,
Expand Down Expand Up @@ -145,7 +148,7 @@ export class IgxColumnResizingService {
this.column.width = (currentColWidth + diff) + 'px';
}

this.column.grid.markForCheck();
this.zone.run(() => {});
this.column.grid.reflow();

if (currentColWidth !== parseFloat(this.column.width)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { IgxColumnResizingService } from './grid-column-resizing.service';
selector: 'igx-grid-header',
templateUrl: './grid-header.component.html'
})
export class IgxGridHeaderComponent implements OnInit, DoCheck {
export class IgxGridHeaderComponent implements DoCheck {

@Input()
public column: IgxColumnComponent;
Expand Down Expand Up @@ -113,10 +113,6 @@ export class IgxGridHeaderComponent implements OnInit, DoCheck {
public filteringService: IgxFilteringService
) { }

public ngOnInit() {
this.column.columnGroup ? this.zone.runTask(() => this.cdr.markForCheck()) :
this.cdr.markForCheck();
}

public ngDoCheck() {
this.getSortDirection();
Expand Down

0 comments on commit f200ac9

Please sign in to comment.