Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(table): show pin mode shadow when using in component with OnPush … #179

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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