Title: iOS: issue when trying to chain modal pages within promise · Issue #5744 · NativeScript/NativeScript · GitHub
Open Graph Title: iOS: issue when trying to chain modal pages within promise · Issue #5744 · NativeScript/NativeScript
X Title: iOS: issue when trying to chain modal pages within promise · Issue #5744 · NativeScript/NativeScript
Description: Did you verify this is a real problem by searching the [NativeScript Forum] YES Which platform(s) does your issue occur on? iOS Tell us about the problem I try to show multiple independent modal pages one after the other using a promise:...
Open Graph Description: Did you verify this is a real problem by searching the [NativeScript Forum] YES Which platform(s) does your issue occur on? iOS Tell us about the problem I try to show multiple independent modal pa...
X Description: Did you verify this is a real problem by searching the [NativeScript Forum] YES Which platform(s) does your issue occur on? iOS Tell us about the problem I try to show multiple independent modal pa...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/5744
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"iOS: issue when trying to chain modal pages within promise","articleBody":"### Did you verify this is a real problem by searching the [NativeScript Forum]\r\n_YES_\r\n\r\n### Which platform(s) does your issue occur on?\r\niOS\r\n\r\n### Tell us about the problem\r\nI try to show multiple independent modal pages one after the other using a promise:\r\n```\r\nnew Promise(function(resolve, reject) {\r\n application.getRootView().showModal(\r\n \"modal-page\",\r\n null,\r\n function() {\r\n resolve(true);\r\n },\r\n false\r\n );\r\n }).then(function(response) {\r\n if(application.getRootView().modal) {\r\n application.getRootView().closeModal();\r\n } else {\r\n console.log(\"closing modal page is not neccessary, as there is no open modal page...\");\r\n }\r\n\r\n try {\r\n application.getRootView().showModal(\r\n \"modal-page\",\r\n null,\r\n function() {\r\n var topmost = frameModule.topmost();\r\n if(topmost) {\r\n topmost.navigate({\r\n moduleName: \"second-page\",\r\n animated: true\r\n });\r\n }\r\n },\r\n false\r\n );\r\n } catch(e) {\r\n console.log(e);\r\n }\r\n });\r\n```\r\nIt opens the first modal page and when I close it to see the next, I always get the following error mesage:\r\n`Error: Parent page is not part of the window hierarchy. Close the current modal page before showing another one!`\r\n\r\nI am not sure if this is the expected behaviour, so I need to know what I am doing wrong. Please note, that in our real app there are some conditions for showing the modal pages, so it might be possible to skip one of the modal pages or even all of them.\r\n\r\n\r\n\r\n### Please provide the following version numbers that your issue occurs with:\r\n- CLI: 4.0.0\r\n- Cross-platform modules: next (4.0.0-2018-04-25-02)\r\n- Runtime(s): 4.0.2\r\n\r\n### Please tell us how to recreate the issue in as much detail as possible.\r\n1. Start the app\r\n2. Tap the button to open the first modal\r\n3. tap the button to close this modal, so the second modal should be opened, but this does not happen on iOS.\r\n\r\n### Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.\r\n[NSIssues4.zip](https://github.com/NativeScript/NativeScript/files/1947861/NSIssues4.zip)\r\n\r\n","author":{"url":"https://github.com/felixkrautschuk","@type":"Person","name":"felixkrautschuk"},"datePublished":"2018-04-25T16:10:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/5744/NativeScript/issues/5744"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6842b1a1-ae75-6df9-e033-323e624711ba |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB7E:F5443:4E68DE8:6A86340:69731516 |
| html-safe-nonce | 20a32b4dbf2d20597dd39eefa70c3b4b8c6143d18210271cd28602322a85b10a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjdFOkY1NDQzOjRFNjhERTg6NkE4NjM0MDo2OTczMTUxNiIsInZpc2l0b3JfaWQiOiIzMjcwMjY0ODA5MDU5NDU2Mjc4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8249ebcf0be6c6bbecd4882c80a5408d216380e7d055756b8bcd5f9c61291387 |
| hovercard-subject-tag | issue:317696192 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/NativeScript/5744/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5803f75159d13046410a3733e1e7f553616832c7e0b1a257722fa3c39975c67f/NativeScript/NativeScript/issues/5744 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5803f75159d13046410a3733e1e7f553616832c7e0b1a257722fa3c39975c67f/NativeScript/NativeScript/issues/5744 |
| og:image:alt | Did you verify this is a real problem by searching the [NativeScript Forum] YES Which platform(s) does your issue occur on? iOS Tell us about the problem I try to show multiple independent modal pa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | felixkrautschuk |
| hostname | github.com |
| expected-hostname | github.com |
| None | 44ab3188c1dcfe3be0f9c3feca2e04e14fb79f120939ce2395e4f15ab96ec1d4 |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 31492490 |
| octolytics-dimension-repository_nwo | NativeScript/NativeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31492490 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/NativeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a5e2b48bd1260476599758f5d253b5d24092ab84 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width