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

Is closing and reopening the modal supposed to keep the old one in dom? #131

Closed
droidzone opened this issue Oct 27, 2019 · 3 comments
Closed
Labels

Comments

@droidzone
Copy link

droidzone commented Oct 27, 2019

I have several elements in a modal which is created on the fly. When I close and reopen the modal, I find that these elements are still in DOM, leading to weird effects of duplication when I try to use data attached to these elements.

Should I do:
onClose: function () { modal.destroy() },
to prevent this behaviour?

@emmanuelballery
Copy link

You can use this.destroy();.

@aardvark82
Copy link

Same issue - calling this.destroy();. onClose() still keeps the modal in DOM - any tips on how to track this down?

@aardvark82
Copy link

Actually the problem was that I was binding multiple listeners on the same object - I eventually had to call
$(".contact").unbind();

on the initiating elem that spawns the modal so that it only gets called once and spawns 1 model

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

No branches or pull requests

4 participants