Skip to content

Commit

Permalink
Fixed #15946 - ButtonComponent: routerLink accessible even when butto…
Browse files Browse the repository at this point in the history
…n is disabled
  • Loading branch information
mehmetcetin01140 committed Jul 9, 2024
1 parent e804cd6 commit 11df3e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/components/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,8 @@ export class ButtonDirective implements AfterViewInit, OnDestroy {
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: {
class: 'p-element'
class: 'p-element',
'[class.p-disabled]': 'disabled' || 'loading'
}
})
export class Button implements AfterContentInit {
Expand Down Expand Up @@ -524,7 +525,6 @@ export class Button implements AfterContentInit {
'p-button p-component': true,
'p-button-icon-only': (this.icon || this.iconTemplate || this.loadingIcon || this.loadingIconTemplate) && !this.label,
'p-button-vertical': (this.iconPos === 'top' || this.iconPos === 'bottom') && this.label,
'p-disabled': this.disabled || this.loading,
'p-button-loading': this.loading,
'p-button-loading-label-only': this.loading && !this.icon && this.label && !this.loadingIcon && this.iconPos === 'left',
'p-button-link': this.link,
Expand Down

0 comments on commit 11df3e9

Please sign in to comment.