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

ConfirmDialog shows double icon in confirm button #13108

Open
StephanBis opened this issue May 27, 2023 · 2 comments
Open

ConfirmDialog shows double icon in confirm button #13108

StephanBis opened this issue May 27, 2023 · 2 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@StephanBis
Copy link

StephanBis commented May 27, 2023

Describe the bug

After updating Angular and PrimeNG to to v15, the ConfirmDialog shows two icons when you set a custom icon. When not defining a custom icon, the default 'checkmark' icon is shown only once, as expected.

image

I'm using the ConfirmationService like this:

this.confirmationService.confirm({
    message: message,
    header: header,
    icon: 'pi pi-exclamation-triangle',
    acceptLabel: this.translateService.instant('general.yes'),
    acceptIcon: 'pi pi-trash',
    acceptButtonStyleClass: 'p-button-danger',
    rejectLabel: this.translateService.instant('general.no'),
    rejectButtonStyleClass: 'p-button-secondary p-button-text',
    accept: accept,
    defaultFocus: 'none'
});

Environment

  • angular: ^15.2.9
  • primeflex: ^3.3.0
  • primeicons: ^6.0.0
  • primeng: ^15.0.0

Reproducer

No response

Angular version

15.2.9

PrimeNG version

15.0.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

16.18.1

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@StephanBis StephanBis added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 27, 2023
@StephanBis StephanBis changed the title ConfirmDialog ConfirmDialog shows double icon in confirm button May 27, 2023
@volvachev
Copy link
Contributor

Hi, it's duplicate #13001

@nelioyann
Copy link
Contributor

nelioyann commented Jul 18, 2023

For those looking for a workaround on version 15.x.x:
You can create a css class:

.hide-duplicated-icon{
  i.pi{
    display: none;
  }
}

Then you can use it whenever you get a duplicated icon like so:

this.confirmationService.confirm({
// [..............]
acceptButtonStyleClass: "p-button-sm p-button-danger hide-duplicated-icon",
acceptIcon: "pi pi-trash"
// [..............]
)}

Should also work once you upgrade to version 16+ as the element i.pi will be removed

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

3 participants