Hi there, I have a bootstrap modal that has a event for 'show.bs.modal'. it loads a form via ajax, and this form has a datepicker object.
everytime you click on datepicker it triggers bootstrap modal's 'show.bs.modal' event. that results reloading form. again.
Any workaround for this 'bug'?
Actually for workaround this issue, I changed my bootstrap event from 'show.bs.modal' to 'shown.bs.modal', I know this is not a solve for this problem, but for now I'm waiting for boostrap-datepicker to solve it.
This worked for me
$(your-date-picker).on("show", function(e){
e.preventDefault();
e.stopPropagation();
}).on("hide", function(e){
e.preventDefault();
e.stopPropagation();
});
thanks !
not sure if the same solution can be applied (as I took zellerda's solution which worked for me) but
https://github.com/uxsolutions/bootstrap-datepicker/pull/642/commits/8b5d19b84d9e1f3163c5ec880bf94d5f70d80029
refers to namespacing the events.
https://github.com/uxsolutions/bootstrap-datepicker/pull/642
I'm not able to try out a similar solution at the moment, but might be a good fit for the next person coming along here looking for alternatives.
Most helpful comment
This worked for me