Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal Buttons not Allowing Custom Classes #13583

Open
wyattpuckett opened this issue Aug 30, 2023 · 1 comment
Open

Modal Buttons not Allowing Custom Classes #13583

wyattpuckett opened this issue Aug 30, 2023 · 1 comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@wyattpuckett
Copy link

Describe the bug

We've noticed that confirm/cancel buttons in primeNG modals cannot have their classes customized. We work with another third-party company to track clicks across our platform. To do this, we insert properties on class attributes for buttons. We've realized that we cannot customize the classes for the dialog-accept and dialog-reject buttons within modals.

Environment

In our environment, the user can create/delete objects. When deleting the object, we use a primeng dialog to allow the user to confirm/reject the deletion. We would like to track which button the user presses by inserting custom properties on the button classes.

Reproducer

No response

Angular version

15.2.1

PrimeNG version

15.3.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

16.18.14

Browser(s)

No response

Steps to reproduce the behavior

  1. Add a dialog component to your code
  2. Attempt to customize the class attributes for the confirm/reject buttons

Expected behavior

Class attributes should allow addition of properties

@wyattpuckett wyattpuckett added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 30, 2023
@dylansyoung
Copy link
Contributor

dylansyoung commented Aug 30, 2023

@wyattpuckett If you use the pTemplate="footer" inside of the dialogs, you can add your own buttons and as then add your own custom classes to the buttons. Example:

<p-confirmDialog #cd [style]="{width: '50vw'}">
    <ng-template pTemplate="header">
        <h3>Header Content</h3>
    </ng-template>
    <ng-template pTemplate="footer">
        <button type="button" class="my-custom-class" pButton icon="pi pi-times" label="No" (click)="cd.reject()"></button>
        <button type="button" class="my-custom-class" pButton icon="pi pi-check" label="Yes" (click)="cd.accept()"></button>
    </ng-template>
</p-confirmDialog>

Does that solve your problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants