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

[Bug] - Disabled button still fires the onclick method attached to it #849

Open
AadhavanVA opened this issue Apr 25, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@AadhavanVA
Copy link

Component
fw-button - https://crayons-next.freshworks.com/components/core/button/

Describe the bug
Disabled button still fired the onclick method attached to it.

To Reproduce
Attaching the recording for reference below

Screen.Recording.2023-04-25.at.3.16.07.PM.mov

Expected behavior
The disabled button should not trigger onclick method attached to it.

@AadhavanVA AadhavanVA added the bug Something isn't working label Apr 25, 2023
@mayhsundar
Copy link

@AadhavanVA
Can we make onclick = null, when assigning the disable attribute to the button?

function disableButton() { myButton.setAttribute('disabled', true); myButton.onclick = null; }

Or can we use css property here for making that disable ?
style="pointer-events: none;"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants