abpetkov / switchery

iOS 7 style switches for your checkboxes
http://abpetkov.github.io/switchery/
2.06k stars 477 forks source link

Switchery Button gets inserted twice #118

Open opalsignum opened 7 years ago

opalsignum commented 7 years ago

Hi, thanks for this awesome plugin.

Unfortunately i have the problem, that once i click on the Switchery toggle it gets inserted a second time to the right. So after the first use, i have two toggles. Everything else works fine.

When i insert all the code at the end of the html doc, the duplicated is removed. But once i click the switchery button it removes itself and there is only the original checkbox left.

Any help would be much appreciated.

abpetkov commented 7 years ago

This sounds like a problem with your code.

Still, if you provide a simplified example of it, I can take a look.

blinkerzz commented 6 years ago

Sounds like recreated a new Switchery() instance whenever you toggle it. Try to remove the existing one with '.switchery' before recreate a new one