Fix buggy context-menu behaviour after cdk update (#2672)

This commit is contained in:
Popovics András
2017-11-20 14:41:21 +00:00
committed by Eugenio Romano
parent d138d6af16
commit a62d550325
2 changed files with 33 additions and 19 deletions

View File

@@ -66,7 +66,7 @@ export class ContextMenuHolderComponent implements OnInit, OnDestroy {
@HostListener('window:resize', ['$event'])
onResize(event) {
if (this.mdMenuElement) {
this.setPosition();
this.setPositionAfterCDKrecalculation();
}
}
@@ -130,10 +130,16 @@ export class ContextMenuHolderComponent implements OnInit, OnDestroy {
this.menuTrigger.openMenu();
if (this.mdMenuElement) {
this.setPosition();
this.setPositionAfterCDKrecalculation();
}
}
setPositionAfterCDKrecalculation() {
setTimeout(() => {
this.setPosition();
}, 0);
}
get mdMenuElement() {
return this.menuElement;
}