{"action":"created","issue":{"url":"https://api.github.com/repos/ionic-team/ionic/issues/10556","repository_url":"https://api.github.com/repos/ionic-team/ionic","labels_url":"https://api.github.com/repos/ionic-team/ionic/issues/10556/labels{/name}","comments_url":"https://api.github.com/repos/ionic-team/ionic/issues/10556/comments","events_url":"https://api.github.com/repos/ionic-team/ionic/issues/10556/events","html_url":"https://github.com/ionic-team/ionic/issues/10556","id":210230987,"number":10556,"title":"Changing page of tab dynamically requires a physical click","user":{"login":"zoinkydoink","id":15949978,"avatar_url":"https://avatars2.githubusercontent.com/u/15949978?v=4","gravatar_id":"","url":"https://api.github.com/users/zoinkydoink","html_url":"https://github.com/zoinkydoink","followers_url":"https://api.github.com/users/zoinkydoink/followers","following_url":"https://api.github.com/users/zoinkydoink/following{/other_user}","gists_url":"https://api.github.com/users/zoinkydoink/gists{/gist_id}","starred_url":"https://api.github.com/users/zoinkydoink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zoinkydoink/subscriptions","organizations_url":"https://api.github.com/users/zoinkydoink/orgs","repos_url":"https://api.github.com/users/zoinkydoink/repos","events_url":"https://api.github.com/users/zoinkydoink/events{/privacy}","received_events_url":"https://api.github.com/users/zoinkydoink/received_events","type":"User","site_admin":false},"labels":[{"id":311009737,"url":"https://api.github.com/repos/ionic-team/ionic/labels/v2","name":"v2","color":"313744","default":false}],"state":"open","locked":false,"assignee":{"login":"manucorporat","id":127379,"avatar_url":"https://avatars2.githubusercontent.com/u/127379?v=4","gravatar_id":"","url":"https://api.github.com/users/manucorporat","html_url":"https://github.com/manucorporat","followers_url":"https://api.github.com/users/manucorporat/followers","following_url":"https://api.github.com/users/manucorporat/following{/other_user}","gists_url":"https://api.github.com/users/manucorporat/gists{/gist_id}","starred_url":"https://api.github.com/users/manucorporat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manucorporat/subscriptions","organizations_url":"https://api.github.com/users/manucorporat/orgs","repos_url":"https://api.github.com/users/manucorporat/repos","events_url":"https://api.github.com/users/manucorporat/events{/privacy}","received_events_url":"https://api.github.com/users/manucorporat/received_events","type":"User","site_admin":false},"assignees":[{"login":"manucorporat","id":127379,"avatar_url":"https://avatars2.githubusercontent.com/u/127379?v=4","gravatar_id":"","url":"https://api.github.com/users/manucorporat","html_url":"https://github.com/manucorporat","followers_url":"https://api.github.com/users/manucorporat/followers","following_url":"https://api.github.com/users/manucorporat/following{/other_user}","gists_url":"https://api.github.com/users/manucorporat/gists{/gist_id}","starred_url":"https://api.github.com/users/manucorporat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manucorporat/subscriptions","organizations_url":"https://api.github.com/users/manucorporat/orgs","repos_url":"https://api.github.com/users/manucorporat/repos","events_url":"https://api.github.com/users/manucorporat/events{/privacy}","received_events_url":"https://api.github.com/users/manucorporat/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2017-02-25T12:11:17Z","updated_at":"2018-04-23T15:33:44Z","closed_at":null,"author_association":"NONE","body":"**Ionic version:**  (check one with \"x\")\r\n[ ] **1.x**\r\n[x ] **2.x**\r\n\r\n**I'm submitting a ...** \r\n[ x] bug report\r\n\r\n**Current behavior:**\r\nI also reported this here.. but no replies\r\n\r\nhttps://forum.ionicframework.com/t/changing-page-of-tab-dynamically-requires-a-physical-click/79879/1\r\n\r\nI have a tab that i assign 2 different pages two depending on some user action, however if i dynamically change the root page of a tab and select it, it does select the right tab but the content is not refreshed with the new page, i have to physically click the tab button AGAIN in order for it to update the content.\r\n\r\nIt seems i need to force a \"click\" event of a tab\r\n\r\nSwitching tabs dynamically/changing their rootpage doesnt seem to do anything until i physically click the tab again\r\n\r\n**Expected behavior:**\r\nExpect the tab to switch and the new root page to show \r\n\r\n**Steps to reproduce:**\r\n1. Initially set one of the tabs pages to Page1 (any page)\r\n2. Dynamically try to set the root page of that tab to another page using the code in related code section\r\n3. the tab will switch, however the tab's page will not (content still showing the old page)\r\n4. physically click the tab again (that was suppose to be switched to)\r\n5. Then expected behavior works (content of the new page shows up)\r\n\r\nFor Ionic 1 issues - http://plnkr.co/edit/Xo1QyAUx35ny1Xf9ODHx?p=preview\r\n\r\nFor Ionic 2 issues - http://plnkr.co/edit/z0DzVL?p=preview\r\n-->\r\n\r\n**Related code:**\r\n`\r\nvar homeTab = navCtrl.parent.getByIndex(0);\r\nhomeTab.root = HomePlacePage;\r\nnavCtrl.parent.select(0);`\r\n\r\n`\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ionic-team/ionic/issues/comments/383618684","html_url":"https://github.com/ionic-team/ionic/issues/10556#issuecomment-383618684","issue_url":"https://api.github.com/repos/ionic-team/ionic/issues/10556","id":383618684,"user":{"login":"JoaoPortella","id":8518225,"avatar_url":"https://avatars2.githubusercontent.com/u/8518225?v=4","gravatar_id":"","url":"https://api.github.com/users/JoaoPortella","html_url":"https://github.com/JoaoPortella","followers_url":"https://api.github.com/users/JoaoPortella/followers","following_url":"https://api.github.com/users/JoaoPortella/following{/other_user}","gists_url":"https://api.github.com/users/JoaoPortella/gists{/gist_id}","starred_url":"https://api.github.com/users/JoaoPortella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoaoPortella/subscriptions","organizations_url":"https://api.github.com/users/JoaoPortella/orgs","repos_url":"https://api.github.com/users/JoaoPortella/repos","events_url":"https://api.github.com/users/JoaoPortella/events{/privacy}","received_events_url":"https://api.github.com/users/JoaoPortella/received_events","type":"User","site_admin":false},"created_at":"2018-04-23T15:33:44Z","updated_at":"2018-04-23T15:33:44Z","author_association":"NONE","body":"This work fine in my case:\r\n\r\n```\r\ncli packages: \r\n    @ionic/cli-utils  : 1.19.2\r\n    ionic (Ionic CLI) : 3.20.0\r\nglobal packages:\r\n    cordova (Cordova CLI) : 6.5.0\r\nlocal packages:\r\n    @ionic/app-scripts : 3.1.8\r\n    Cordova Platforms  : android 6.1.2\r\n    Ionic Framework    : ionic-angular 3.9.2\r\nSystem:\r\n    Android SDK Tools : 26.0.1\r\n    Node              : v6.10.3\r\n    npm               : 3.10.10\r\n    OS                : Windows 10\r\n\r\n//\r\nlet tabIndex = 2; // This is your tab index\r\nlet myTab = this.navCtrl.parent.getByIndex(tabIndex);\r\nmyTab.setRoot(NewPage); // NewPage component is your new page to load\r\n//\r\n```"}}
{"actor":{"display_login":"JoaoPortella"}}