saribe / eModal

Easy Modal for bootstrap, is a simple way to create modal dialogs using javascript.
http://saribe.github.io/eModal
271 stars 97 forks source link

hide.bs.modal is firing twice #60

Open rmvanmeeuwen opened 8 years ago

rmvanmeeuwen commented 8 years ago

Hi,

I try to do some checks on form state inside the modal dialog, before actually closing the modal (by 'x'). So I wrote a piece of code:

$(document).on('hide.bs.modal', '#myeModal', function () {
        alert(this.id);
    });

(I edited the eModal.js so the modal part has id myeModal. But this event is fired twice (once before actually closing (as excpected) and one after the modal has been closed. It seems that something is not correct inside eModal.js? I cannot find the spot where/how to fix it

saribe commented 7 years ago

Hide.bs.hide is handled by bootstrap it self, however will take a look ASAP..

On 3 Nov 2016 10:37, "rmvanmeeuwen" notifications@github.com wrote:

Hi,

I try to do some checks on form state inside the modal dialog, before actually closing the modal (by 'x'). So I wrote a piece of code:

$(document).on('hide.bs.modal', '#myeModal', function () { alert(this.id); });

(I edited the eModal.js so the modal part has id myeModal. But this event is fired twice (once before actually closing (as excpected) and one after the modal has been closed. It seems that something is not correct inside eModal.js? I cannot find the spot where/how to fix it

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/saribe/eModal/issues/60, or mute the thread https://github.com/notifications/unsubscribe-auth/AEFCJ_Qq24grkRzjMXTrGea7aUue5UlKks5q6bligaJpZM4KoM9C .

rmvanmeeuwen commented 7 years ago

ok, thanks!

Tahiche commented 7 years ago

Same here. 'hidden.bs.modal' is firing twice,

lshe7842 commented 6 years ago

Any updates? BTW, seems there's a workaround which actually works: https://github.com/twbs/bootstrap/issues/9111