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

Fix button loading issue #13489 #13676

Merged
merged 1 commit into from
Sep 22, 2023
Merged

Conversation

TheWrightDev
Copy link
Contributor

Fixes #13489

@vercel
Copy link

vercel bot commented Sep 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
primeng-ssr-test ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 14, 2023 11:18pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
primeng ⬜️ Ignored (Inspect) Visit Preview Sep 14, 2023 11:18pm

if (this.loading && !this.loadingIcon && iconElement) {
iconElement.innerHTML = this.spinnerIcon;
} else if (iconElement?.innerHTML) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a personal opinion but always I prefer a simple if instead else if.
It's cleaner for me, but PrimeNG Team will decide :). Thanks for your contribution

if (this.loading && !this.loadingIcon && iconElement) {
    iconElement.innerHTML = this.spinnerIcon;
}

if (iconElement?.innerHTML) {
    iconElement.innerHTML = '';
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh for sure, I have zero preference. Just would really like to see this make it in the next release since it's blocking us from upgrading since all of our buttons are use the pButton directive instead of the p-button element.

Though I think to avoid just undoing the loading spinner it would have to be:

if (this.loading && !this.loadingIcon && iconElement) {
    iconElement.innerHTML = this.spinnerIcon;
}

if (!this.loading && iconElement?.innerHTML) {
    iconElement.innerHTML = '';
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a PR fixing something similar in pButton and <p-button time ago #13363

Maybe I forgot something and with your code I hope works 100%

@cetincakiroglu cetincakiroglu merged commit 0bf5750 into primefaces:master Sep 22, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pButton | Loading icon not removing
3 participants