Skip to content

Commit

Permalink
fix(popover-edit): Call markForCheck against row hover content when s…
Browse files Browse the repository at this point in the history
…howing (angular#18258)
  • Loading branch information
kseamon authored and yifange committed Jan 30, 2020
1 parent c12ed17 commit a86b8f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/cdk-experimental/popover-edit/table-directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,10 @@ export class CdkRowHoverContent implements AfterViewInit, OnDestroy {
if (!this.viewRef) {
this.viewRef = this.viewContainerRef.createEmbeddedView(this.templateRef, {});
this.initElement(this.viewRef.rootNodes[0] as HTMLElement);
this.viewRef.markForCheck();
} else if (this.viewContainerRef.indexOf(this.viewRef) === -1) {
this.viewContainerRef.insert(this.viewRef!);
this.viewRef.markForCheck();
}

if (eventState === HoverContentState.ON) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component} from '@angular/core';
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {DataSource} from '@angular/cdk/collections';
import {NgForm} from '@angular/forms';
import {BehaviorSubject, Observable} from 'rxjs';
Expand Down Expand Up @@ -40,6 +40,7 @@ const ELEMENT_DATA: PeriodicElement[] = [
selector: 'popover-edit-tab-out-mat-table-example',
styleUrls: ['popover-edit-tab-out-mat-table-example.css'],
templateUrl: 'popover-edit-tab-out-mat-table-example.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class PopoverEditTabOutMatTableExample {
displayedColumns: string[] = ['position', 'name', 'weight', 'symbol'];
Expand Down

0 comments on commit a86b8f9

Please sign in to comment.