switchery icon indicating copy to clipboard operation
switchery copied to clipboard

Double onchange event with label

Open Badestrand opened this issue 6 years ago • 1 comments

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!

Badestrand avatar Jun 14 '18 20:06 Badestrand

Hi, I fixed this in my fork. https://github.com/jirikrepl/switchery/commit/174cb248c7504f5b1e9bf1b87579b7861d2af212

jirikrepl avatar Apr 30 '22 14:04 jirikrepl