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

pButton | Loading icon not removing #13489

Closed
GiacomoDM opened this issue Aug 11, 2023 · 3 comments · Fixed by #13676
Closed

pButton | Loading icon not removing #13489

GiacomoDM opened this issue Aug 11, 2023 · 3 comments · Fixed by #13676
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@GiacomoDM
Copy link
Contributor

Describe the bug

Only with the directive pButton, when the loading status of a button with a an icon changes, the loading indicator is not removed:
image

Using the component p-button instead of the directive works.

Environment

Windows

Reproducer

https://stackblitz.com/edit/gmhqyu?file=src%2Fapp%2Fdemo%2Fbutton-loading-demo.html

Angular version

16.X

PrimeNG version

16.2.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

16.20

Browser(s)

No response

Steps to reproduce the behavior

  1. Open the provided stackblitz
  2. Click on any button to start the loaders
  3. After 2 seconds the loaders stops, but the loading icon is not removed for the buttons with the directive pButton

Expected behavior

At step 3, pButton should behave the same a p-button.

@GiacomoDM GiacomoDM 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 11, 2023
@SoyDiego
Copy link
Contributor

Oh no, more problems with buttons :(

image

@knightSarai
Copy link

Using p-button might break some styles, a work around this is to supply loadingIcon, something like this:
`
<button
pButton
type="button"
icon="pi pi-search"
loadingIcon="pi pi-spin pi-spinner"
[loading]="loading"

`

@LexanRed
Copy link

LexanRed commented Aug 31, 2023

I can confirm this issue. In my case it was the other way round, the spinner did not show up despite the loading property changing from false to true.

When supplying the loadingIcon as @knightSarai mentioned, it works.

When setting the loading property to true, it still disables the button. If setting the property to true before the button is rendered, it also shows the spinner.

Maybe there is some issue with change detection here?

TheWrightDev added a commit to TheWrightDev/primeng16.3.1.1 that referenced this issue Sep 14, 2023
TheWrightDev added a commit to TheWrightDev/primeng16.3.1.1 that referenced this issue Sep 14, 2023
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Sep 22, 2023
@cetincakiroglu cetincakiroglu added this to the 16.4.0 milestone Sep 22, 2023
cetincakiroglu added a commit that referenced this issue Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants