cordova-plugin-dialogs
cordova-plugin-dialogs copied to clipboard
feat: set cancelable to false by default on Android
To match with the iOS behavior where all modals cannot be canceled by a click outside of it (or a back button). First of all, there is few case where it is interesting for the developper to let the user dismiss the modal by a simple click outside of the modal. And it's absolutely not user friendly, the user does not attempt to see the modal closing after this action. He can cancel it unintentionally.
Maybe a setting would be a great solution too ?
Here some testimonies of developers that have trouble with this (not only with cordova) : https://github.com/jquery/jquery-mobile/issues/4727 http://stackoverflow.com/questions/23300122/prevent-phonegap-notification-navigator-popups-from-closing-from-touch-outside-o http://programming.nullanswer.com/question/27626010 http://iswwwup.com/t/5fcbb227c8f7/javascript-prevent-kendo-tooltip-hide-close-when-clicking-outside-the-tooltip.html
++
++
It's easy to tap outside of the box unintentionally. Also you may wonder what happens if you tap outside instead of clicking OK/Cancel (did I just OKed or Cancelled it?).
I'm actually already using a modified version of this plugin just to change that setCancelable
part.
@RomainFallet maybe you could simply update the calls to alert
, confirm
, ... and add another argument isCancelable
that would default to false
as to not change the current behavior on Android. Maybe people don't want to merge the PR as it's not backward compatible?
I just saw https://github.com/apache/cordova-plugin-dialogs/pull/60 that actually added a setCanceledOnTouchOutside
. I don't know if both setCanceled
and setCanceledOnTouchOutside
should be set (in my app I only use setCanceled(false)
and it prevents both back button and clicking outside to close the dialog).
++
++ Please...
any news on it?
Any news?