Skip to content

Commit

Permalink
Fixed #9482 - When no label is assigned to pButton, the button should…
Browse files Browse the repository at this point in the history
… not render  
  • Loading branch information
yigitfindikli committed Apr 6, 2021
1 parent 7694800 commit e26337b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/components/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ export class ButtonDirective implements AfterViewInit, OnDestroy {
labelElement.setAttribute('aria-hidden', 'true');
}
labelElement.className = 'p-button-label';
labelElement.appendChild(document.createTextNode(this.label||' '));

if (this.label)
labelElement.appendChild(document.createTextNode(this.label));
else
labelElement.innerHTML = ' ';

this.el.nativeElement.appendChild(labelElement);
this.initialized = true;
}
Expand Down

0 comments on commit e26337b

Please sign in to comment.