Skip to content

Commit

Permalink
Merge pull request #17013 from primefaces/issue-16968
Browse files Browse the repository at this point in the history
Fixed #16968 | Component: DynamicDialog - breakpoints are ignored
  • Loading branch information
mehmetcetin01140 authored Dec 11, 2024
2 parents ed716fd + f70af2a commit 598e839
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/primeng/src/dynamicdialog/dynamicdialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const hideAnimation = animation([animate('{{transition}}', style({ transform: '{
[style.height]="ddconfig.height"
[attr.aria-labelledby]="ariaLabelledBy"
[attr.aria-modal]="true"
[attr.id]="dialogId"
>
<div *ngIf="ddconfig.resizable" [ngClass]="'p-resizable-handle'" style="z-index: 90;" (mousedown)="initResize($event)"></div>
<div #titlebar [ngClass]="'p-dialog-header'" (mousedown)="initDrag($event)" *ngIf="ddconfig.showHeader !== false">
Expand Down Expand Up @@ -281,6 +282,10 @@ export class DynamicDialogComponent extends BaseComponent implements AfterViewIn
};
}

get dialogId() {
return this.attrSelector;
}

constructor(
public renderer: Renderer2,
public ddconfig: DynamicDialogConfig,
Expand All @@ -297,6 +302,7 @@ export class DynamicDialogComponent extends BaseComponent implements AfterViewIn
this.createStyle();
}
}

createStyle() {
if (isPlatformBrowser(this.platformId)) {
if (!this.styleElement) {
Expand All @@ -307,7 +313,7 @@ export class DynamicDialogComponent extends BaseComponent implements AfterViewIn
for (let breakpoint in this.breakpoints) {
innerHTML += `
@media screen and (max-width: ${breakpoint}) {
.p-dialog[${this.attrSelector}]:not(.p-dialog-maximized) {
.p-dialog[id=${this.dialogId}]:not(.p-dialog-maximized) {
width: ${this.breakpoints[breakpoint]} !important;
}
}
Expand Down

0 comments on commit 598e839

Please sign in to comment.