Skip to content

Can't open modal within modal due to ViewHierarchy error on IOS. #612

@rnmhdn

Description

@rnmhdn

Version

2.5.0

Reproduction link

https://play.nativescript.org/?template=play-vue&id=mQF8k3&v=3

Platform and OS info

Android 8 / nativescript 6.5 / 5.4.15-arch1-1

Steps to reproduce

  • Click on Button (A modal should pop up)
  • Click on Button (Nothing will happen and you will get an error

What is expected?

You should see a new popup open.

What is actually happening?

You get the error:

ViewHierarchy: parent is already presenting view controller close the current modal page before showing another one!


Closing modal 1 and openning modal 2 / using navigation are not viable workarounds for this issue if what you intend for the user is to see modal 1 when they close modal 2 and

  • you are have multiple navigations in both modal 1 and modal 2
  • you use a custom modal component that has a close button etc and handles closure in certain ways.
  • some of your modals return dynamic values upon their closure
  • you have hooks to run on modal's closure for both modal 1 and modal 2
  • you report closure of modal 1 to server for usage analysis.
  • many other things that other people might do but I'm not doing in my app.

Please see this issue in nativescript repository.
Please see this stackoverflow question.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions