Skip to content

Commit

Permalink
Fixed #1777 - Improve custom content option on Button
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Jan 26, 2021
1 parent 81b676f commit bcfc7c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ export class Button extends Component {
}

renderLabel() {
if (!this.props.label) {
return <span className="p-button-label p-c" dangerouslySetInnerHTML={{ __html: "&nbsp;" }}></span>
if (this.props.label) {
return <span className="p-button-label p-c">{this.props.label}</span>;
}

return <span className="p-button-label p-c">{this.props.label}</span>
return !this.props.children && !this.props.label && <span className="p-button-label p-c" dangerouslySetInnerHTML={{ __html: "&nbsp;" }}></span>
}

renderBadge() {
Expand Down

0 comments on commit bcfc7c0

Please sign in to comment.