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.
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.
5 Answers, 1 is accepted
0
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
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!
0

Fernando
Top achievements
Rank 1
answered on 28 Jul 2014, 03:13 PM
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.
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.
0
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
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!
0

Fernando
Top achievements
Rank 1
answered on 05 Aug 2014, 02:15 PM
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.
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.
0
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
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!