Skip to content

Commit

Permalink
fix(table): show pin mode shadow with OnPush change detection (#179)
Browse files Browse the repository at this point in the history
Closes #177
  • Loading branch information
daniel-sc authored and kyubisation committed Sep 19, 2019
1 parent 1585d00 commit d97749a
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
HostBinding,
Input,
Expand Down Expand Up @@ -69,7 +70,7 @@ export class TableComponent implements OnChanges, OnDestroy {

private _scrollListener = new Subject();

constructor(private _zone: NgZone) {}
constructor(private _zone: NgZone, private _changeDetectorRef: ChangeDetectorRef) {}

ngOnChanges(changes: SimpleChanges): void {
if (!stickySupported) {
Expand All @@ -87,7 +88,12 @@ export class TableComponent implements OnChanges, OnDestroy {
takeUntil(this._scrollListener),
distinctUntilChanged()
)
.subscribe(v => this._zone.run(() => (this._scrolling = v)));
.subscribe(v =>
this._zone.run(() => {
this._scrolling = v;
this._changeDetectorRef.markForCheck();
})
);
} else if (
changes.pinMode.currentValue === 'off' &&
changes.pinMode.previousValue !== changes.pinMode.currentValue
Expand Down

0 comments on commit d97749a

Please sign in to comment.