PitPik/tinyDatePicker

DatePicker inside modal dialog

Opened this issue · 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.

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.

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

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

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