tinyDatePicker icon indicating copy to clipboard operation
tinyDatePicker copied to clipboard

DatePicker inside modal dialog

Open umbundu opened this issue 7 years ago • 4 comments

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.

umbundu avatar Jun 30 '17 18:06 umbundu

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.

PitPik avatar Jul 01 '17 15:07 PitPik

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

umbundu avatar Jul 03 '17 18:07 umbundu

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 :)

maryhaak avatar Jul 27 '17 14:07 maryhaak

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

umbundu avatar Jul 28 '17 13:07 umbundu