From 556971fa89a39b134b75d58af632fe2bf96c7e96 Mon Sep 17 00:00:00 2001 From: Egor Volvachev <axe.onegaimy@gmail.com> Date: Mon, 12 Jun 2023 09:10:12 +0300 Subject: [PATCH] fix(primeng/p-confirmDialog): not updated style in runtime Fixes #13155. --- src/app/components/confirmdialog/confirmdialog.ts | 10 +++++++++- src/app/components/contextmenu/contextmenu.ts | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app/components/confirmdialog/confirmdialog.ts b/src/app/components/confirmdialog/confirmdialog.ts index 3024c787f12..68032a81f3c 100755 --- a/src/app/components/confirmdialog/confirmdialog.ts +++ b/src/app/components/confirmdialog/confirmdialog.ts @@ -140,7 +140,13 @@ export class ConfirmDialog implements AfterContentInit, OnInit, OnDestroy { * Inline style of the element. * @group Props */ - @Input() style: { [klass: string]: any } | null | undefined; + @Input() get style(): { [klass: string]: any } | null | undefined { + return this._style; + } + set style(value: { [klass: string]: any } | null | undefined) { + this._style = value; + this.cd.markForCheck(); + } /** * Class of the element. * @group Props @@ -361,6 +367,8 @@ export class ConfirmDialog implements AfterContentInit, OnInit, OnDestroy { _visible: boolean | undefined; + _style: { [klass: string]: any } | null | undefined; + maskVisible: boolean | undefined; documentEscapeListener: any; diff --git a/src/app/components/contextmenu/contextmenu.ts b/src/app/components/contextmenu/contextmenu.ts index 5798d21c76a..bcf36634f97 100755 --- a/src/app/components/contextmenu/contextmenu.ts +++ b/src/app/components/contextmenu/contextmenu.ts @@ -342,7 +342,7 @@ export class ContextMenu implements AfterViewInit, OnDestroy { if (this.global) { const documentTarget: any = this.el ? this.el.nativeElement.ownerDocument : 'document'; this.triggerEventListener = this.renderer.listen(documentTarget, this.triggerEvent, (event) => { - if(this.containerViewChild && this.containerViewChild.nativeElement.style.display !== 'none') { + if (this.containerViewChild && this.containerViewChild.nativeElement.style.display !== 'none') { this.hide(); } this.show(event); @@ -350,7 +350,7 @@ export class ContextMenu implements AfterViewInit, OnDestroy { }); } else if (this.target) { this.triggerEventListener = this.renderer.listen(this.target, this.triggerEvent, (event) => { - if(this.containerViewChild && this.containerViewChild.nativeElement.style.display !== 'none') { + if (this.containerViewChild && this.containerViewChild.nativeElement.style.display !== 'none') { this.hide(); } this.show(event);