PitPik / tinyDatePicker

NEW: Tiny javascript and jQuery date / time picker [datepicker]
http://www.dematte.at/tinyDatePicker/
MIT License
57 stars 14 forks source link

DatePicker inside modal dialog #11

Open umbundu opened 7 years ago

umbundu commented 7 years ago

If you have a date picker inside a modal dialog, nothing happens: it seems that the wiring is broken so nothing happens when you click the input box.

PitPik commented 7 years ago

Hi @umbundu , thanks for your findings. I just updated tinyDatePicker and added the possibility to set the event listener as an option. So, when setting up your datePicker you might want to set the option body to the element of the modal window. This way the datePicker gets appended inside but also the event listener is listening to the modal window. I'm guessing that the modal window prevents the event to go all the way to document.body and therefore doesn't do anything. Let me know if this works for you.

umbundu commented 7 years ago

Greetings, I tried but still cannot get it to work, Thanks.

maryhaak commented 6 years ago

Hi @umbundu, I've managed to fix datepicker in modal dialog. Just use two options: renderCallback and body.

  1. Set input closest wrapper to body
  2. paste this code in renderCallback function: container.style.cssText = !this.isOpen ? 'display: none' : 'display: block';

@PitPik Thank you for cool library :)

umbundu commented 6 years ago

Mary, How are you? I will give it a try. Thank you so much! Do svidanya Everardo