-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Button: p-button executing methods on click when disabled #12495
Comments
When using p-button you have to use (onClick)="foo()". When using onClick with p-button the click event will not fire when the button is disabled. I struggled with this too until I found the following deep in the documentation. Events <button pButton type="button" label="Click" (click)="handleClick($event)"> |
PrimeNg developers need to be notified :) , this problem also occurs in components that themselves use p-buttons, such as fileupload I saw that there are very old issues about this problem. I have an idea that it is not easy to fix it, it depends on how chromium intercepts the (click) event |
@volvachev @cosmin19 explained the problem very well, it doesn't depend on the graphic style. |
Hi, this class adds |
I have to pay you for a coffee. do cats like coffee? thank you. |
Cats like coffee only with milk 😉. What about dogs? |
Describe the bug
Code:
Bug: foo method is executed on click even though the button is disabled. This happens only when using p-button.
If I'm using
the foo method is not executed.
Environment
Angular 15.0.4
PrimeNG 15.0.1
Tested in Chrome Version 108.0.5359.124 (Official Build) (64-bit)
Reproducer
No response
Angular version
15.0.4
PrimeNG version
15.0.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.12.1
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
Disabled buttons should not execute methods on click.
The text was updated successfully, but these errors were encountered: