{"action":"created","issue":{"url":"https://api.github.com/repos/ionic-team/ionic/issues/16449","repository_url":"https://api.github.com/repos/ionic-team/ionic","labels_url":"https://api.github.com/repos/ionic-team/ionic/issues/16449/labels{/name}","comments_url":"https://api.github.com/repos/ionic-team/ionic/issues/16449/comments","events_url":"https://api.github.com/repos/ionic-team/ionic/issues/16449/events","html_url":"https://github.com/ionic-team/ionic/issues/16449","id":384192722,"node_id":"MDU6SXNzdWUzODQxOTI3MjI=","number":16449,"title":"【Ionic 4】ionic fast back issues","user":{"login":"AIxiuxiu","id":17570496,"node_id":"MDQ6VXNlcjE3NTcwNDk2","avatar_url":"https://avatars2.githubusercontent.com/u/17570496?v=4","gravatar_id":"","url":"https://api.github.com/users/AIxiuxiu","html_url":"https://github.com/AIxiuxiu","followers_url":"https://api.github.com/users/AIxiuxiu/followers","following_url":"https://api.github.com/users/AIxiuxiu/following{/other_user}","gists_url":"https://api.github.com/users/AIxiuxiu/gists{/gist_id}","starred_url":"https://api.github.com/users/AIxiuxiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AIxiuxiu/subscriptions","organizations_url":"https://api.github.com/users/AIxiuxiu/orgs","repos_url":"https://api.github.com/users/AIxiuxiu/repos","events_url":"https://api.github.com/users/AIxiuxiu/events{/privacy}","received_events_url":"https://api.github.com/users/AIxiuxiu/received_events","type":"User","site_admin":false},"labels":[{"id":999106337,"node_id":"MDU6TGFiZWw5OTkxMDYzMzc=","url":"https://api.github.com/repos/ionic-team/ionic/labels/package:%20angular","name":"package: angular","color":"dc0030","default":false},{"id":999100804,"node_id":"MDU6TGFiZWw5OTkxMDA4MDQ=","url":"https://api.github.com/repos/ionic-team/ionic/labels/package:%20core","name":"package: core","color":"1d76db","default":false},{"id":1143756678,"node_id":"MDU6TGFiZWwxMTQzNzU2Njc4","url":"https://api.github.com/repos/ionic-team/ionic/labels/type:%20bug","name":"type: bug","color":"cc2302","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-11-26T06:36:35Z","updated_at":"2018-12-27T09:00:16Z","closed_at":null,"author_association":"NONE","body":"# Bug Report\r\n\r\n**Ionic Info**\r\nRun `ionic info` from a terminal/cmd prompt and paste the output below.\r\n\r\n```\r\nIonic:\r\n\r\n   ionic (Ionic CLI)             : 4.4.0 (/Users/xayq-fanxl/.nvm/versions/node/v8.11.2/lib/node_modules/ionic)\r\n   Ionic Framework               : @ionic/angular 4.0.0-beta.16\r\n   @angular-devkit/build-angular : 0.10.6\r\n   @angular-devkit/schematics    : 7.0.6\r\n   @angular/cli                  : 7.0.6\r\n   @ionic/angular-toolkit        : 1.2.0\r\n```\r\n\r\n**Describe the Bug**\r\nAfter navigate into a detail page,I quickly click the back button，this details page will not destroy\r\n\r\n**Steps to Reproduce**\r\nSteps to reproduce the behavior:\r\n1. Use `ionic start ionic_app blank  --type=angular`  create a new project，Add a new page 'me' with `ionic g page`\r\n2. Home page add code to jump to me page\r\n```\r\n<ion-header>\r\n  <ion-toolbar>\r\n    <ion-buttons slot=\"start\">\r\n      <ion-button color=\"primary\" href=\"/me\" routerDirection=\"forward\">\r\n        <ion-icon slot=\"icon-only\" name=\"contact\"></ion-icon>\r\n      </ion-button>\r\n    </ion-buttons>\r\n    <ion-title>\r\n      Ionic Blank\r\n    </ion-title>\r\n  </ion-toolbar>\r\n</ion-header>\r\n```\r\nme page add code to back\r\n```\r\n<ion-header>\r\n  <ion-toolbar>\r\n    <ion-buttons slot=\"start\">\r\n      <ion-back-button color=\"primary\" text=\"&nbsp;&nbsp;&nbsp;&nbsp;\"></ion-back-button>\r\n    </ion-buttons>\r\n    <ion-title>me</ion-title>\r\n  </ion-toolbar>\r\n</ion-header>\r\n```\r\n3. Click button navigate to me page and quickly click the back button\r\n4. See error\r\nme page not destroy ,home page toobar showing the me page toobar\r\n![](https://raw.githubusercontent.com/AIxiuxiu/readme_add_pic/master/ionic_back.png)\r\n\r\nThe right situation\r\n![](https://raw.githubusercontent.com/AIxiuxiu/readme_add_pic/master/ionic_back_right.png)\r\n\r\n**note**\r\nI found that only use mode=\"ios\" will happen, when I use  mode=\"md\" to index.html `<html lang=\"en\" mode=\"md\">` no problem"},"comment":{"url":"https://api.github.com/repos/ionic-team/ionic/issues/comments/450108234","html_url":"https://github.com/ionic-team/ionic/issues/16449#issuecomment-450108234","issue_url":"https://api.github.com/repos/ionic-team/ionic/issues/16449","id":450108234,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDEwODIzNA==","user":{"login":"georgechr","id":865564,"node_id":"MDQ6VXNlcjg2NTU2NA==","avatar_url":"https://avatars3.githubusercontent.com/u/865564?v=4","gravatar_id":"","url":"https://api.github.com/users/georgechr","html_url":"https://github.com/georgechr","followers_url":"https://api.github.com/users/georgechr/followers","following_url":"https://api.github.com/users/georgechr/following{/other_user}","gists_url":"https://api.github.com/users/georgechr/gists{/gist_id}","starred_url":"https://api.github.com/users/georgechr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgechr/subscriptions","organizations_url":"https://api.github.com/users/georgechr/orgs","repos_url":"https://api.github.com/users/georgechr/repos","events_url":"https://api.github.com/users/georgechr/events{/privacy}","received_events_url":"https://api.github.com/users/georgechr/received_events","type":"User","site_admin":false},"created_at":"2018-12-27T09:00:16Z","updated_at":"2018-12-27T09:00:16Z","author_association":"NONE","body":"Expanding from @AIxiuxiu 's solution, overriding IonBackButtonDelegate's onclick event seems to work consistently, even when a defaultHref path is declared:\r\n```\r\nIonBackButtonDelegate.prototype.onClick = function (ev) {\r\n            if (!that.canGoBack) {\r\n                return false\r\n            }\r\n            if (this.routerOutlet && this.routerOutlet.canGoBack()) {\r\n                this.routerOutlet.pop();\r\n                ev.preventDefault();\r\n            }\r\n            else if (this.defaultHref != null) {\r\n                this.navCtrl.navigateBack(this.defaultHref);\r\n                ev.preventDefault();\r\n            }\r\n        };\r\n```\r\n\r\nBut yes, this is a workaround at best, this needs to be fixed properly as it puts the app in a non-recoverable state and the user has to kill it and restart"}}
{"actor":{"display_login":"georgechr"}}