Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p-toggleButton trigger "click" event handler when disabled. #16744

Open
linkdotnet opened this issue Nov 14, 2024 · 1 comment · May be fixed by #16787
Open

p-toggleButton trigger "click" event handler when disabled. #16744

linkdotnet opened this issue Nov 14, 2024 · 1 comment · May be fixed by #16787
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team
Milestone

Comments

@linkdotnet
Copy link

Describe the bug

Given a component as such:

<p-toggleButton
  [disabled]="true"
  onLabel="PrimeNG"
  offLabel="PrimeNG"
  (click)="onClick()"
></p-toggleButton>
{{ counter }}

With the following onClick handler:

counter = 0;

onClick() {
  this.counter++;
}

Environment

Reproducer

No response

Angular version

18.2

PrimeNG version

18.0.0-beta.3

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.20.4

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

If a button is disabled, it shouldn't trigger its click event handler code.

@linkdotnet linkdotnet added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 14, 2024
@mertsincan mertsincan added Resolution: Help Wanted Issue or pull request requires extra help and feedback and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 19, 2024
@mertsincan mertsincan added this to the Future milestone Nov 19, 2024
Copy link

Due to PrimeNG team's busy roadmap, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. ✨ Thank you for your contribution! ✨

mateuszstudentzero pushed a commit to mateuszstudentzero/primeng-zio that referenced this issue Nov 20, 2024
@mertsincan mertsincan modified the milestones: Future, 17.18.13 Nov 21, 2024
@mertsincan mertsincan added Status: Pending Review Issue or pull request is being reviewed by Core Team and removed Resolution: Help Wanted Issue or pull request requires extra help and feedback labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team
Projects
None yet
2 participants