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

Double onchange event with label #160

Open
Badestrand opened this issue Jun 14, 2018 · 1 comment
Open

Double onchange event with label #160

Badestrand opened this issue Jun 14, 2018 · 1 comment

Comments

@Badestrand
Copy link

Badestrand commented Jun 14, 2018

Hi

It is a known issue that Switchery fires the onchange event twice when it is inside a label <label><input ..></label>. Issues #50 and #51 were about this, for example.

I am using Switchery again currently and am annoyed by that behaviour. I would like to commit a pull request to fix it but before I do the work in vein I would like to know: Would you (the mods) accept and merge the pull request if it fixes the issue and looks reasonable?

Or this there any problem I should know about why this wasn't fixed yet? Maybe it is harder than it looks (just prevent event propagation on click)?

And thanks for this project, I really like using it!

jirikrepl added a commit to jirikrepl/switchery that referenced this issue Apr 30, 2022
- when switcher is inside `<label>` then onChange event is fired twice
  - one because of lablel click
  - one because of click on switcher

  abpetkov#160
@jirikrepl
Copy link

Hi, I fixed this in my fork. jirikrepl@174cb24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants