Skip to content

Commit

Permalink
Fixed #15651 - Button | Opacity is applied twice on disabled state --…
Browse files Browse the repository at this point in the history
…> wrong opacity
  • Loading branch information
mehmetcetin01140 committed Jun 11, 2024
1 parent e5f593e commit d95c669
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/app/components/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,7 @@ export class ButtonDirective implements AfterViewInit, OnDestroy {
</defs>
</svg>`;

constructor(
public el: ElementRef,
@Inject(DOCUMENT) private document: Document
) {}
constructor(public el: ElementRef, @Inject(DOCUMENT) private document: Document) {}

ngAfterViewInit() {
DomHandler.addMultipleClasses(this.htmlElement, this.getStyleClass().join(' '));
Expand Down Expand Up @@ -373,8 +370,7 @@ export class ButtonDirective implements AfterViewInit, OnDestroy {
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: {
class: 'p-element',
'[class.p-disabled]': 'disabled' || 'loading'
class: 'p-element'
}
})
export class Button implements AfterContentInit {
Expand Down

1 comment on commit d95c669

@demike
Copy link

@demike demike commented on d95c669 Jun 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mehmetcetin01140 isn't this bringing back the original problem, that the click event on p-button fires even if the member disabled is true?

Please sign in to comment.