Nativescript: [ios][modal][dialogs] dialog appears behind modal view on iOS 12.x with tns-core-modules 6.3.x+

Created on 26 Aug 2020  路  5Comments  路  Source: NativeScript/NativeScript

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.8.0
  • Cross-platform modules:
  • Android Runtime: 6.5.3
  • iOS Runtime: 6.5.2
  • Plugin(s): tns-core-modules 6.5.3+
    Xcode Version 11.5 (11E608c)

Describe the bug
I have found a backwards compat bug within our ns ng project for launching dialogs within modals when using iOS 12.x and tns-core-modules 6.5.3+. It seems that the dialog launches behind the modal currently on the screen. We also notice that it does not occur in iOS 13.x and works.

I have been able to pin it down to a change from tns-core-modules 6.5.2 -> 6.5.3. #8609
Especially in the dialogs.ios.ts implementation for showUIAlertController seems to handle views and their modals differently. Im not sure if there is an underlying change from iOS 12.x -> 13.x when it comes to views and their modals.

We have a large corporate user base which remains on iOS 12.x, so upgrading to the latest iOS will be troublesome.

To Reproduce
Use tns-core-modules 6.5.3 - 6.5.15 and a device with iOS 12.x. Launch a modal with showModal() api and then launch a confirm or alert dialog within it. The dialog will appear below the current modal view.

Expected behavior
Dialogs should always appear above the current modal view, for major n-2 versions?

Sample project
Playground Link
https://play.nativescript.org/?template=play-ng&id=JckOxW

You will need to ideally download this project and run it with tns-core-modules 6.5.3+ on an iOS 12.x device to see the issue.

* Additional Context *
We are patiently waiting for NS 7.0 release before we upgrade to the ng-10 world.

Most helpful comment

@pekevski thanks for reporting this - we can probably conditionally hook that for lower iOS versions - we鈥檒l see what can work there.

All 5 comments

Hi @pekevski
Thank you for reporting this issue.
We are going to try replicate this case on our end and will provide the needed fix. For further info, you could keep track the issue.

Hi @pekevski
https://github.com/NativeScript/NativeScript/pull/8609 This fix was to resolve issues like these, can you use this PR as a guide and manually patch on a custom pack of the version you are willing to use.
Let me know how it goes.

Hi @Ross-Olivares ,
I referenced that fix as the cause of the problem. It looks like that fix wont work for iOS 12.x.
If you upgrade to tns-core-modules 6.5.3 (which the referenced fix is in) the problem begins to occur.
However, we don't see this issue occur for iOS 13.x

Any thoughts on what specifically about the changes might cause the problem?
Has the view.modal flag been deprecated in iOS 13.x?

@pekevski thanks for reporting this - we can probably conditionally hook that for lower iOS versions - we鈥檒l see what can work there.

Today we just found out that this also affects openFile on iOS 12.x for tns-core-modules v6.5.2 as seen in (#8527 ). Opening a file using the utils method launches the file behind the modal. I am not sure if they are directly related?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rLoka picture rLoka  路  3Comments

nirsalon picture nirsalon  路  3Comments

OscarLopezArnaiz picture OscarLopezArnaiz  路  3Comments

kn9ts picture kn9ts  路  3Comments

Leo-lay picture Leo-lay  路  3Comments