From 4f8971f35c74a7ce972a3e1ae43440cb7f12b5c5 Mon Sep 17 00:00:00 2001 From: TheWrightDev Date: Thu, 14 Sep 2023 16:04:00 -0700 Subject: [PATCH] Fix button loading issue #13489 --- src/app/components/button/button.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/app/components/button/button.ts b/src/app/components/button/button.ts index 17ff3772760..e44c9df85d0 100755 --- a/src/app/components/button/button.ts +++ b/src/app/components/button/button.ts @@ -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) {