Skip to content

Commit 5c9f0d6

Browse files
kseamonjelbourn
authored andcommitted
fix(popover-edit): Call markForCheck against row hover content when showing (#18258)
1 parent 944837f commit 5c9f0d6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/cdk-experimental/popover-edit/table-directives.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,10 @@ export class CdkRowHoverContent implements AfterViewInit, OnDestroy {
439439
if (!this.viewRef) {
440440
this.viewRef = this.viewContainerRef.createEmbeddedView(this.templateRef, {});
441441
this.initElement(this.viewRef.rootNodes[0] as HTMLElement);
442+
this.viewRef.markForCheck();
442443
} else if (this.viewContainerRef.indexOf(this.viewRef) === -1) {
443444
this.viewContainerRef.insert(this.viewRef!);
445+
this.viewRef.markForCheck();
444446
}
445447

446448
if (eventState === HoverContentState.ON) {

src/components-examples/material-experimental/popover-edit/popover-edit-tab-out-mat-table/popover-edit-tab-out-mat-table-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component} from '@angular/core';
1+
import {ChangeDetectionStrategy, Component} from '@angular/core';
22
import {DataSource} from '@angular/cdk/collections';
33
import {NgForm} from '@angular/forms';
44
import {BehaviorSubject, Observable} from 'rxjs';
@@ -40,6 +40,7 @@ const ELEMENT_DATA: PeriodicElement[] = [
4040
selector: 'popover-edit-tab-out-mat-table-example',
4141
styleUrls: ['popover-edit-tab-out-mat-table-example.css'],
4242
templateUrl: 'popover-edit-tab-out-mat-table-example.html',
43+
changeDetection: ChangeDetectionStrategy.OnPush,
4344
})
4445
export class PopoverEditTabOutMatTableExample {
4546
displayedColumns: string[] = ['position', 'name', 'weight', 'symbol'];

0 commit comments

Comments
 (0)