Skip to content

Toggle event is being fired twice #63

@crephix

Description

@crephix

Hello,
I wonder why the toggle event is being fired twice when clicked. This is my code and it outputs the console.log twice each case:

$('.toggle').on('toggle', function(e, active) {
        if(active)
          console.log("Aktiv!" + active);
        else
          console.log("Inaktiv!" + active);
      })

I noticed that if the user completely swipes the toggle element it is only being fired once. I just want to do ONE MySQL query once the state has changed, how would I do so?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions