6

I have a cordova app that runs on iPads and I recently got a very strange behavior with the new IPadOS 13+.

Some javascript native functions that should block the code flow and waits for user inputs ( like window.alert or window.confirm ) are no longer doing it. Therefore, the whole app functionality is compromised.

for example:

if(confirm("Are you sure ?"))
{
    ... // This block is not waiting for user input and executing straight away.
} 

OR

// ... some normal program flow

alert('anything here'); // Normally the program should wait for the user to press 'OK' button.

// ... rest of the code that doesn't wait for the alert to be closed

This is a lot of trouble for the entire app, do you know any solution for this ? or anything that could help ? I cannot downgrade the ios version back to 12 anymore either.

PS. Im not sure, but could this be a bug from the safari webview version for IOS 13 ?

Thanks for the help

Igor Leal
  • 61
  • 2
  • you need to also share the context which you are trying this. Confirm was and is still blocking – Nidhin Joseph Oct 31 '19 at 22:23
  • Hey Nidhin, thanks for the reply. Thats a very strange behavior. It seems that the confirms are only executing the IF block that i post the seccond time I press it. Not blocking at all the rest of the function ( after the if statment ) – Igor Leal Nov 01 '19 at 18:08
  • is it possible to share a snippet of the code please? – Nidhin Joseph Nov 02 '19 at 00:23
  • Nidhin, yes it is, I will share a very simple one, so you can understand the problem: `// Normal program execution flow alert('anything here '); // Rest of the program that does not waits for the alert to be closed ` – Igor Leal Nov 03 '19 at 01:13
  • 1
    I do confirm that alert, prompt,confirm are non blocking in UIWebView as of iOS 13. – h3dkandi Nov 13 '19 at 11:56
  • Hey @h3dkandi, are you having similar issues ? – Igor Leal Nov 15 '19 at 18:32
  • @IgorLeal Yes. I couldn't find a way to override the confirm() in such a way to make it blocking. I implemented my own confirm that has a callback in its parameters. After the user decides on confirmation the callback is called with the user decision and all your post confirm logic goes in the callback. This however break the previously linear execution which might be a deal breaker for some. – h3dkandi Nov 18 '19 at 12:53
  • h3dkandi, this is crazy, they should not do this kind of changes. it will break entire apps : ( – Igor Leal Nov 18 '19 at 16:50
  • Same issue here, any solution for this that doesn't implies implement a new confirm method? – Natalia Gutiérrez Dec 26 '19 at 10:06
  • @IgorLeal apparently this problem has been solved in IPadOS 13.4.1, at least for me it's working fine! – Natalia Gutiérrez Apr 21 '20 at 11:00
  • @NataliaGutiérrez thats good to hear! – Igor Leal Nov 29 '21 at 05:07

0 Answers0