Skip to content

Commit

Permalink
Fixed #14569
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Jan 18, 2024
1 parent 99b6e8f commit 3527f2f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/components/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ export class ButtonDirective implements AfterViewInit, OnDestroy {
}

createLabel() {
if (this.label) {
const created = DomHandler.findSingle(this.htmlElement, '.p-button-label');
if (!created && this.label) {
let labelElement = this.document.createElement('span');
if (this.icon && !this.label) {
labelElement.setAttribute('aria-hidden', 'true');
Expand All @@ -166,7 +167,8 @@ export class ButtonDirective implements AfterViewInit, OnDestroy {
}

createIcon() {
if (this.icon || this.loading) {
const created = DomHandler.findSingle(this.htmlElement, '.p-button-icon');
if (!created && (this.icon || this.loading)) {
let iconElement = this.document.createElement('span');
iconElement.className = 'p-button-icon';
iconElement.setAttribute('aria-hidden', 'true');
Expand Down

0 comments on commit 3527f2f

Please sign in to comment.