Skip to content

Commit

Permalink
Fixed #16963 | v18-rc.2 Component: ConfirmationDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed Dec 6, 2024
1 parent bc0d612 commit 08ce156
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/primeng/src/confirmdialog/confirmdialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const hideAnimation = animation([animate('{{transition}}', style({ transform: '{
*ngIf="option('rejectVisible')"
[label]="rejectButtonLabel"
(onClick)="onReject()"
[styleClass]="cx('pcRejectButton', option('rejectButtonStyleClass'))"
[styleClass]="getButtonStyleClass('pcRejectButton', 'rejectButtonStyleClass')"
[ariaLabel]="option('rejectButtonProps', 'ariaLabel')"
[buttonProps]="getRejectButtonProps()"
>
Expand All @@ -92,7 +92,7 @@ const hideAnimation = animation([animate('{{transition}}', style({ transform: '{
<p-button
[label]="acceptButtonLabel"
(onClick)="onAccept()"
[styleClass]="cx('pcAcceptButton', option('acceptButtonStyleClass'))"
[styleClass]="getButtonStyleClass('pcAcceptButton', 'acceptButtonStyleClass')"
*ngIf="option('acceptVisible')"
[ariaLabel]="option('acceptButtonProps', 'ariaLabel')"
[buttonProps]="getAcceptButtonProps()"
Expand Down Expand Up @@ -275,6 +275,7 @@ export class ConfirmDialog extends BaseComponent implements OnInit, OnDestroy {
@Input() get visible(): any {
return this._visible;
}

set visible(value: any) {
this._visible = value;

Expand Down Expand Up @@ -434,6 +435,13 @@ export class ConfirmDialog extends BaseComponent implements OnInit, OnDestroy {
return undefined;
}

getButtonStyleClass(cx: string, opt: string): string {
const cxClass = this.cx(cx);
const optionClass = this.option(opt);

return [cxClass, optionClass].filter(Boolean).join(' ');
}

getElementToFocus() {
switch (this.option('defaultFocus')) {
case 'accept':
Expand Down

0 comments on commit 08ce156

Please sign in to comment.