Skip to content

fix: fixed the back button issue in the mobile app

Back Navigation Implementation in EHRS App

Problem

In the EHRS mobile application, when users pressed the device back button or used the back navigation gesture, the app was exiting instead of navigating to the previous screen. This resulted in a poor user experience and unexpected app closures.

Solution

To resolve this issue, I implemented custom back navigation handling using Capacitor plugins. By listening to the native backButton event provided by Capacitor, I overrode the default system behavior.

Updated Behavior

  • If the user is not on the home screen, the app navigates to the previous page within the app.
  • If the user is on the home screen, the app handles the back action appropriately (e.g., double-tap to exit or controlled exit logic).

This implementation ensures smooth in-app navigation and prevents accidental app exits, significantly improving the overall user experience.

Edited by Bikkumalla Sai Krishna

Merge request reports

Loading