mymth / vanillajs-datepicker

A vanilla JavaScript remake of bootstrap-datepicker for Bulma and other CSS frameworks
MIT License
753 stars 155 forks source link

Clicking on a datepicker-cell triggers bootstrap 5 modal closing #139

Open JVT038 opened 1 year ago

JVT038 commented 1 year ago

Like the title says. I have a datepicker inside of a bootstrap modal and when I click on a cell (a year, month, decade), it triggers the modal to close. For some reason bootstrap thinks the datepicker is outside of the modal, which causes it to close. Can this be fixed?

mymth commented 1 year ago

I can't reproduce the problem. https://codepen.io/mymth/pen/dygPNZg

I guess some other program may be doing something like this

document.querySelectorAll('#myModal span').forEach((spanElem) => {
  spanElem.addEventListener('click', () => {
    // ...do something
    //
    myModal.hide();
  });
});