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

Functions on fields-added get executed twice #109

Open
robbevp opened this issue Aug 19, 2019 · 0 comments
Open

Functions on fields-added get executed twice #109

robbevp opened this issue Aug 19, 2019 · 0 comments

Comments

@robbevp
Copy link

robbevp commented Aug 19, 2019

I can't seem to figure out why, but function that wait on fields-added seem to be executed twice

So

$(document).on("fields_added.nested_form_fields", function(){
  console.log("hi")
});

gives two times hi in the console

# file.js
var i = 0
$(document).on("fields_added.nested_form_fields", function(){
  i += 1
  console.log(i)
});

results in

# console
1 file.js:44:11
2 file.js:44:11

Any suggestions on what could cause this?

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

1 participant