I am trying to disable click outside the confirm message in JS. Is there any simple solution for this issue? If the confirm message show up on mobile, and i click outside of it.. it will dissapear, but i need it to stay as it is.
if (confirm("Are u sure?")) {
}
I am also using this function in webview. Maybe there is a problem? Anyone have any suggestions?
EDIT: I found the problem is in the webview.
I am using AlertDialog builder and i do not calling the function setCanceledOnTouchOutside();
2
Answers
For anybody in the future, who is making jsAlert with builder. You just need to call .setCancelable(false) before .create(); in Android Studio project.
You can use model to disable click outside. You want to set the backdrop value to static. You may also want to set the keyboard property to false because that prevents the modal from being closed
In JS:
or in HTML