DatePicker doesn't open in ionic modal

2 posts, 0 answers
  1. Vinicius
    Vinicius avatar
    2 posts
    Member since:
    May 2020

    Posted 29 May Link to this post

    Hi, I have an DatePicker in an ionic modal. 

    But for some reason it doesn't open and gives no errors in cosole. It is just a copy and paste from the basic example in the docs.

    That is any reason for this to happen?

  2. Svetlin
    Admin
    Svetlin avatar
    391 posts

    Posted 02 Jun Link to this post

    Hi Vinicius,

    I am not sure what is the default behavior of the Ionic modal, but it should be causing the reported behavior.

    In general, whenever the DatePicker is focused it adds its popup to the root level within the DOM. It is possible that the Ionic modal doesn't allow to focus an item that is rendered outside the DOM of the modal. What could be done in such cases is to use the appendTo property of the DatePicker popupSettings to render the popup within the DOM of the modal. Please check the following issue on a similar case, where the DatePicker is used inside a Bootstrap modal, and see the suggested usage of the popupSettings.appendTo property:

    https://github.com/telerik/kendo-angular/issues/1984#issuecomment-447779522

    Another option would be to use the Kendo Dialog:

    https://stackblitz.com/edit/angular-mnjh6g?file=app/app.component.ts

    I hope the provided information helps. Feel free to write back in case any further assistance is required for this case. Thank you.

    Regards,
    Svetlin
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top