confirm alert box is displayed for 2 times in phone gap - ios

I am using notification.confirm in my iPhone application using phonegap.
$("#buttonId").click(function(e){
buyDialogBox();
});
function buyDialogBox(){
navigator.notification.confirm(
getIndRestrictionText(), // message
onConfirm, // callback to invoke with index of button pressed
'confirm alert Box', // title
'ok,Cancle' // buttonLabels
);
}
function onConfirm( button ){
if( button == 1 ){
alert("Ok button is clicked");
}else{
alert("cancel button is clicked");
}
}
while button is clicked and we press the ok or cancel button then immediately confirm alert box is displayed for second time for very small amount of period.
I am wondering that why the confirm alert box is displayed for second time.
Please give me solution for that.

Related

How do I prevent clicking background when I click the IMGUI button

How do I prevent clicking background when I click the IMGUI button
(e.g. I click the translate button and also click the background)
Check whether ImGui wants to capture the mouse click using ImGui::GetIO().WantCaptureMouse. If it does then don't let the event propagate further.
void Application::handleInput(InputEvent event) {
// don't pass mouse and keyboard presses further if an ImGui widget is active
auto& io = ImGui::GetIO();
if (io.WantCaptureMouse || io.WantCaptureKeyboard) {
return;
}
// ... event processing
}
}
ImGui FAQ: Q: How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?

How to dismiss keyboard on change app lifecycle state

How to dismiss keyboard in flutter when I change the app using task list or if I pressed home button on iOS and double click home button and got back to app
You can reproducer the problem by doing the follow:
focus Textfield so keyboard will appear and double press home button on iPhone to switch to another app using task list then again double press home button and switch back to your app!
The keyboard stays and not responding
I tried the following :
#override
void didChangeAppLifecycleState(AppLifecycleState state) {
print('state = $state');
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) {
currentFocus.focusedChild!.unfocus();
}
SystemChannels.textInput.invokeMethod('TextInput.hide');
}

Xamarin iOS - Dismiss dialog notification

I use UIImagePickerController to open image from photo library.
I can register handlers for both accept and cancel events
imagePicker.Canceled += (sender, eventArgs) =>
{
//handle cancelling...
}
imagePicker.FinishedPickingMedia += (sender, args) =>
{
//handle loading...
}
These two handlers get called when user picks a photo, or clicks the Cancel button.
But, when user closes the dialog by swipe down gesture, I do not get my Cancel event handler called, what I believe should happen (as the user indeed has canceled the load operation).
So, what am I missing ?
Is there any other event that I can subscribe to, to get notified when user closes dialog by swiping it down the screen?

Meteor: Disable calling automatically on iOS when tapping on phone number

I am using Meteor Framework.
The following code
123-456-7890
or
(123) 456-7890
Initiates a call automatically in iOS.
I need some kind of warning.. such as pop up saying
Call 123-456-7890 ?
and if the user wants to call then they can press Call or else Cancel.
How do I fix this on iOS?
You have two options.
First, you could wrap the call link inside a pop up or modal. In your template:
<a class="open-popup">Call 123-456-7890</a>
Open the pop up via click event. In Meteor you can do this like this:
Template.myTemplateName.events({
"click a.open-popup": function(event) {
// Open pop up ...
});
In this pop up you place the link 123-456-7890 alongside with a cancle button, which is nothing else than a pop up closer. <a class="close-popup">cancle</a>
Second, use a click event with confirm() function and then do a url redirect to the `tel://ยด address.
Template.myTemplateName.events({
"click a.open-popup": function(event) {
var r = confirm("Call 123-456-7890 ?");
if (r == true) {
let phoneNumber = "123-456-7890";
window.location.href="tel://"+phoneNumber;
} else {
// closes
}
});
I guess, the second option is easier to implement and already does, what you are looking for.

set bootbox dialog window focus through select2-open event

I am opening a bootbox dialog box when the user click inside select-2 input box using the following code
$("#categoryfinder").on("select2-open", function () {
bootbox.confirm("Are you sure?", function (result) {
Example.show("Confirm result: " + result);
});
});
Once it is opened, the popup window is not active and I have to click twice to close or to trigger any event on the popup
Please let me know if there is any solution for this.
EDIT: when I click inside 1, the popup is not active at 1,2,3, I have to click once to make it active.
I fixed this issue by doing the following changes
$("#allergenfinder").on("select2-opening", function (e) {
e.preventDefault();
excludeAllergenPrompt();
});

Resources