{"action":"closed","issue":{"url":"https://api.github.com/repos/telerik/nativescript-ui-samples/issues/47","labels_url":"https://api.github.com/repos/telerik/nativescript-ui-samples/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/telerik/nativescript-ui-samples/issues/47/comments","events_url":"https://api.github.com/repos/telerik/nativescript-ui-samples/issues/47/events","html_url":"https://github.com/telerik/nativescript-ui-samples/issues/47","id":122879005,"number":47,"title":"Cannot close modal on page with a sidedrawer","user":{"login":"maknz","id":992356,"avatar_url":"https://avatars.githubusercontent.com/u/992356?v=3","gravatar_id":"","url":"https://api.github.com/users/maknz","html_url":"https://github.com/maknz","followers_url":"https://api.github.com/users/maknz/followers","following_url":"https://api.github.com/users/maknz/following{/other_user}","gists_url":"https://api.github.com/users/maknz/gists{/gist_id}","starred_url":"https://api.github.com/users/maknz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maknz/subscriptions","organizations_url":"https://api.github.com/users/maknz/orgs","repos_url":"https://api.github.com/users/maknz/repos","events_url":"https://api.github.com/users/maknz/events{/privacy}","received_events_url":"https://api.github.com/users/maknz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-18T04:48:55Z","updated_at":"2015-12-18T07:06:33Z","closed_at":"2015-12-18T07:06:33Z","body":"On iOS, if you call closeCallback() to close a modal, you get a crash when you have a RadSideDrawer on the page:\r\n\r\n```\r\nCONSOLE LOG file:///app/views/settings.js:42:18: pin was correct\r\nfile:///app/tns_modules/ui/core/view-common.js:843:101: JS ERROR Error: View already has a parent. View: ContentView Parent: RadSideDrawer<side-drawer>\r\n1   0x1020e8c39 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)\r\n2   0x1026abafd ffi_closure_unix64_inner\r\n3   0x1026ae8ee ffi_closure_unix64\r\n4   0x1037ddf6c -[UIViewController __viewWillAppear:]\r\n5   0x1038167a1 -[UINavigationController viewWillAppear:]\r\n6   0x1037dd8d1 -[UIViewController _setViewAppearState:isAnimating:]\r\n7   0x1037ddf6c -[UIViewController __viewWillAppear:]\r\n8   0x1037ab77f __56-[UIPresentationController runTransitionForCurrentState]_block_invoke\r\n9   0x10364d4a2 _runAfterCACommitDeferredBlocks\r\n10  0x103660c01 _cleanUpAfterCAFlushAndRunDeferredBlocks\r\n11  0x10366caf3 _afterCACommitHandler\r\n12  0x1055be367 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__\r\n13  0x1055be2d7 __CFRunLoopDoObservers\r\n14  0x1055b3f2b __CFRunLoopRun\r\n15  0x1055b3828 CFRunLoopRunSpecific\r\n16  0x10815fad2 GSEventRunModal\r\n17  0x103641610 UIApplicationMain\r\n18  0x1026ae76c ffi_call_unix64\r\n19  0x116fed210\r\n(lldb)\r\n```\r\n\r\nCode that shows the modal and when closed causes the crash:\r\n\r\n```js\r\n page.showModal(\"views/modals/pin-modal\", {}, function (pinWasCorrect) {\r\n    if (pinWasCorrect) {\r\n      console.log(\"pin was correct\");\r\n    }\r\n  });\r\n```\r\n\r\nAbridged XML to show how we use the sidedrawer:\r\n\r\n```xml\r\n<Page xmlns=\"http://schemas.nativescript.org/tns.xsd\" navigatingTo=\"navigatingTo\" xmlns:drawer=\"nativescript-telerik-ui/sidedrawer\" xmlns:content=\"modules/side-drawer-content\">\r\n  <drawer:RadSideDrawer id=\"side-drawer\" loaded=\"drawerLoad\">\r\n    <drawer:RadSideDrawer.drawerContent>\r\n      <content:SideDrawerContent />\r\n    </drawer:RadSideDrawer.drawerContent>\r\n    <drawer:RadSideDrawer.mainContent class=\"main-page-content\">\r\n      <StackLayout id=\"page-content\">\r\n        <!-- Items in the view. A button's tap handler is used to open the modal with the code above --> \r\n    </drawer:RadSideDrawer.mainContent>\r\n  </drawer:RadSideDrawer>\r\n</Page>\r\n```"}}