Skip to content

Commit

Permalink
fix(primeng/p-confirmDialog): not updated style in runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
volvachev committed Jun 12, 2023
1 parent 229bb94 commit 556971f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/app/components/confirmdialog/confirmdialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/contextmenu/contextmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,15 +342,15 @@ 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);
event.preventDefault();
});
} 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);
Expand Down

0 comments on commit 556971f

Please sign in to comment.