Close prevention

6 posts, 0 answers
  1. Fernando
    Fernando avatar
    56 posts
    Member since:
    Sep 2012

    Posted 23 Jul 2014 Link to this post

    Hi,

    Is preventing the modal view from closing officially supported?

    I've put a preventDefault() on the close event, but when you set the modal option to false and touch outside the window, the modal view closes but overlay stays there, blocking the app. However, closing the modal view programmatically works perfectly.

    Please see this example for reproducing the case:
    http://dojo.telerik.com/iBUr/2

    Thanks in advance.
  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 25 Jul 2014 Link to this post

    Hi Fernando,

    In order to prevent the close action on a Kendo UI Mobile ModalView, you can execute preventDefault() in the close event of the widget, as shown in this example:

    http://dojo.telerik.com/IbUK

    I have a few remarks about your setup:

    1. Attaching click events with onclick, will not work reliably well in mobile device, please check the above example on how to attach a  click handler that will work correctly on mobile touch devices.

    2.  $("#modalview-login").kendoMobileModalView("close"); - this is not the correct API way for closing the ModalWindow, please check the above example for the correct way of calling the close() method. Same is valid for the open() method as well.

    I hope this information will be helpful.

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Fernando
    Fernando avatar
    56 posts
    Member since:
    Sep 2012

    Posted 28 Jul 2014 Link to this post

    Hi, Kiril

    Thanks for your reply.

    About your observations, the code I provided was copied from this demonstration page: http://demos.telerik.com/kendo-ui/modalview/adaptive
    If this is a wrong way of using the API, I think it should be corrected on the examples.

    In any way, the problem that I pointed also occurs on the example you provided. If you click (or touch) on the overlay, outside the ModalWindow, it closes, but the screen is kept dark.
  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 29 Jul 2014 Link to this post

    Hello Fernando,

    I can now understand what exactly is the issue that you are facing and managed to reproduce it on my end as well. I have logged it in our internal bug tracker, where you can track the progress:

    https://github.com/telerik/kendo-ui-core/issues/203

    In the mean time can you please explain a bit more what is your exact scenario, so we can offer you a workaround. If you set the modal option to true, then the above problem will not occur, however I am not really sure if this is what you need.

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Fernando
    Fernando avatar
    56 posts
    Member since:
    Sep 2012

    Posted 05 Aug 2014 Link to this post

    Thanks for acknowledging the issue!

    We need the user to confirm that he wants to close the modal, because the inserted data would be lost.

    We temporarily enabled the modal option, but we prefer leaving it disabled for usability issues.
  7. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 06 Aug 2014 Link to this post

    Hello Fernando,

    I really hope that the issue will be resolved soon. In case you have any further questions, please do not hesitate to contact us.

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready