Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set cancelable to false by default on Android #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

feat: set cancelable to false by default on Android #56

wants to merge 1 commit into from

Conversation

RomainFallet
Copy link

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) :
jquery-archive/jquery-mobile#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

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 no 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.

Here some testimonies of developers that have trouble with this (not only with cordova) :
jquery-archive/jquery-mobile#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
@kavka3
Copy link

kavka3 commented Sep 29, 2015

++

@Heshyo
Copy link

Heshyo commented Oct 30, 2015

++
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?

@Heshyo
Copy link

Heshyo commented Oct 30, 2015

I just saw #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).

@roushd5
Copy link

roushd5 commented Aug 18, 2016

++

@darron1217
Copy link

darron1217 commented Jan 3, 2017

++
Please...

ryanwilliams83 pushed a commit to Busivid/cordova-plugin-dialogs that referenced this pull request Aug 23, 2017
@MaxInMoon
Copy link

any news on it?

@goran-blazin
Copy link

Any news?

@janpio janpio changed the title set cancelable to false by default on Android feat: set cancelable to false by default on Android Jul 4, 2019
Copy link
Member

@janpio janpio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard conflict, so this can't be merged directly. Either @RomainFallet rebases and fixes the conflicts, or someone has to create a new PR with theses changes based on current master.

Caution: This would be a breaking, major change as it changes current behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants