orige-zz / jquery-bootstrap-modal-steps

A lightweight step by step modal for bootstrap
MIT License
30 stars 36 forks source link

Title is appended not replaced using bootstrap datepicker #7

Open robjens opened 8 years ago

robjens commented 8 years ago

On 'focus' event of a bootstrap datepicker field

image

Looking at the code, last bit seems like you add a span each time instead of replace it. Is this intentional?

robjens commented 8 years ago

Hmm so I do not get why it is firing on the BS datepicker events as well, when you put the .on calls as methods on the modal I provided. This is really the problem, shouldn't the show(n) and hidden be bound to ONLY that element?

BS3 documentation says: All modal events are fired at the modal itself (i.e. at the <div class="modal">). So why does it trigger on child elements as well?

robjens commented 8 years ago

Got why the hidden didn't fire. There is something off in the names of the events:

You use show in concordance with hidden but these pairs are shown:hidden and show:hide so if I change the hidden to hide, it suddenly works. Now all I need to do is:

.on('show.bs.modal', function (e) {
  if (!$($modal.selector).is(e.target)) { return; }
})...

and use that with hide as well

AdilSarwarNU commented 8 years ago

@robjens Can you explain a little more how did you fix this problem? I am unable to fix this with the above mentioned information!