Closed FConstantMovework closed 3 years ago
Closing in favor of https://github.com/ionic-team/ionic-framework/issues/22773.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Bug Report
Ionic version: 5.30.0
Current behavior: On app start, any click on back button causes the app to exit, whitout firing backbutton or ionBackButton events. Annoying in the case of programmaticaly navigating to a page on app launch.
Expected behavior: Nothing should happen if navigation history is empty, or app should navigate back if navigation history is not empty.
Steps to reproduce: Start new app: ionic start BugBackButton tabs --cordova
Paste given code in app.component.js
Run it: ionic cordova run android
Press back button: app exits instead of displaying alert() and navigating back
Related code:
Other information: As soon as user navigates by touching a navigation element or open menu unexpected behaviour stops occuring. It need to be a "physical" touch that occurs, as even trigering a click event on navigation element initiate navigation but doesn't solve the problem.
Ionic info: