Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Back Button Behavior - Requires Multiple Presses to Exit When Switching Tabs #101

Open
e-labInnovations opened this issue Sep 22, 2024 · 1 comment

Comments

@e-labInnovations
Copy link

e-labInnovations commented Sep 22, 2024

When using Firefly-Pico as a PWA on Android, switching between the bottom tabs (e.g., Home, Add, Transactions, Settings, etc.) causes the back button to behave unexpectedly. Specifically, after switching tabs, pressing the Android back button requires multiple presses to exit the application. The number of presses needed corresponds to how many times the user has switched tabs.

Expected Behavior:

When switching between tabs, the Android back button should not step back through each tab change. Instead, it should either:

  1. Exit the application if the user is on a main tab, or

  2. Navigate within the current tab if the user has drilled down into a deeper page (e.g., viewing a transaction detail).

Steps to Reproduce:

  1. Open Firefly-Pico as a PWA on an Android device.

  2. Switch between the bottom tabs (e.g., Home -> Add -> All Transactions).

  3. Press the Android back button.

  4. Notice that the back button steps back through each tab change, requiring multiple presses to exit the application.

Proposed Solution:

Implement a custom back button handler to:

  1. Prevent tab switches from being added to the browser history stack.

  2. Make the back button behave like a native app—exiting the application when on a main tab, or navigating back only within a single tab's deeper navigation flow.

@cioraneanu
Copy link
Owner

Thank you for your suggestion 👍 Adding it as something nice to have later down the road, since not everyone uses Android and not everyone uses the PWA version.

If you find this valuable you can try to submit a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants