Confirm dialog does not show up after a custom dialog


#1

I’m opening a custom dialog and after that dialog closes I need to show a Confirm dialog.
The Confirm dialog does not show up, if called from within the .then() of a custom dialog.

I’ve set up a playground to show the problem: https://play.nativescript.org/?template=play-ng&id=tlRK9w

There are 2 buttons on the home screen:

  • the first one shows a sample confirm and an alert after confirm is closed
  • the second shows a custom dialog to select names from a list, and after a selection it calls the same confirm

You can see that in the first case confirm+alert does work, but in the second case the confirm fails to show up, although the same function is called on both cases and the log shows that.

I’ve tried to add a timeout before calling the confirm function, from the custom dialog, but that did not help.

Is that a bug? Is there a workaround to get that working?

TIA
julio


#2

Ok first, this bug is confusing and should not behave how it is… second (although not a great solution) when I increased the timeout to 1000 milliseconds it worked as expected. Anything less would not release correctly to fire the dialog.

For others:

  • It’s not zone related (tested with running inside of a zone)
  • It’s not related to having a user interaction to display chained dialogs (simulating button taps in code causes no change)

I would recommend reporting this issue on nativescript-angular’s repository. We shouldn’t have to be wrapping things in a setTimeout.


#3

Opened Issue #5218 on nativescript/nativescript.