Skip to content

Commit

Permalink
fix: Button icon only regression. Fixed: #17338
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Jan 9, 2025
1 parent eafb8b1 commit 536fccc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/showcase/assets/styles/layout/_core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ html {
font-size: 14px;
font-family: "Inter var", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-feature-settings: "cv02","cv03","cv04","cv11";
line-height: normal;
line-height: 1.2;
}

.material {
Expand Down
2 changes: 1 addition & 1 deletion packages/primeng/src/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ export class ButtonDirective extends BaseComponent implements AfterViewInit, OnD
<span *ngIf="icon && !iconTemplate && !_iconTemplate" [class]="icon" [ngClass]="iconClass()" [attr.data-pc-section]="'icon'"></span>
<ng-template [ngIf]="!icon && (iconTemplate || _iconTemplate)" *ngTemplateOutlet="iconTemplate || _iconTemplate; context: { class: iconClass() }"></ng-template>
</ng-container>
<span class="p-button-label" [attr.aria-hidden]="icon && !label" *ngIf="!contentTemplate && !_contentTemplate" [attr.data-pc-section]="'label'">{{ label || '&nbsp;' }}</span>
<span class="p-button-label" [attr.aria-hidden]="icon && !label" *ngIf="!contentTemplate && !_contentTemplate && label" [attr.data-pc-section]="'label'">{{ label }}</span>
<p-badge *ngIf="!contentTemplate && !_contentTemplate && badge" [value]="badge" [severity]="badgeSeverity"></p-badge>
</button>
`,
Expand Down
6 changes: 6 additions & 0 deletions packages/primeng/src/button/style/buttonstyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ const theme = ({ dt }) => `
gap: ${dt('button.gap')};
}
.p-button-icon,
.p-button-icon:before,
.p-button-icon:after {
line-height: inherit;
}
.p-button:disabled {
cursor: default;
}
Expand Down

0 comments on commit 536fccc

Please sign in to comment.