primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Component: ConfirmDialog - Add boolean options showAcceptIcon and showRejectIcon

Open lightzane opened this issue 2 years ago • 4 comments

Describe the feature you would like to see added

As a developer, I want to customize or hide the icons in the Yes/No button of ConfirmDialog So that I will not have extra whitespaces when there is no PrimeIcon or icon is set to null or undefined

Is your feature request related to a problem?

No response

Describe the solution you'd like

Add boolean options showAcceptIcon and showRejectIcon

Describe alternatives you have considered

No response

Additional context

Just a note: PrimeNG has default icons by default in the YES/NO button of ConfirmDialog while PrimeReact does not have default icons.

lightzane avatar Jul 31 '22 09:07 lightzane

Hi @lightzane, this feature already exist, there are 2 input called acceptVisible and rejectVisible.

Btw if you want there is an anuglar feature called content projection, you can add your own custom template to the modal, see Customization in https://www.primefaces.org/primeng/confirmdialog

bozzelliandrea avatar Aug 02 '22 06:08 bozzelliandrea

@bozzelliandrea the acceptVisible is not what I'm looking for as it will just remove the entire button:

this.confirmationService.confirm({
  message: 'Are you sure?',
  acceptVisible: false,
});

image

I want an option to just remove the icon inside the buttons. Like how PrimeReact is doing by default: image

However, customizing the template footer of the p-confirmDialog is okay. Like I will just add more line of codes whereareas I just want to remove the icon on the buttons. Maybe workaround is to just add global styles for now.

I just had experience with PrimeReact and by default, they don't add icons on the buttons.

lightzane avatar Aug 03 '22 02:08 lightzane

@lightzane Ok, now i understand what are you looking for, there are 2 Input called rejectIcon and acceptIcon, if you set the value empty or false for example, your result is exactly the same behavior of PrimeReact

Code

image

Showcase

image

However 2 new boolean input for handle a "show" flag could be good, but the behavior will be similar to that described above, unless the inputs are handled differently.

bozzelliandrea avatar Aug 03 '22 06:08 bozzelliandrea

@bozzelliandrea I think we're still going to stick with the template.

As providing false in acceptIcon or rejectIcon will still leave some extra whitespaces on the left of the Yes and No buttons.

image

Unlike using the template, will actually remove the icon without the extra whitespaces:

image

lightzane avatar Aug 08 '22 06:08 lightzane

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap? Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!

Best Regards,

mertsincan avatar Nov 09 '22 21:11 mertsincan