Skip to content

Commit

Permalink
Fix button loading issue #13489
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWrightDev authored Sep 14, 2023
1 parent 23d8ee1 commit 4f8971f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/app/components/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,10 @@ export class ButtonDirective implements AfterViewInit, OnDestroy {
let iconElement = DomHandler.findSingle(this.htmlElement, '.p-button-icon');
let labelElement = DomHandler.findSingle(this.htmlElement, '.p-button-label');

if (!this.icon && !this.loading) {
iconElement && this.htmlElement.removeChild(iconElement);
return;
}

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

if (iconElement) {
Expand Down

0 comments on commit 4f8971f

Please sign in to comment.