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

Hardware back button is double handled #2752

Closed
josh-griffin opened this issue Apr 22, 2020 · 3 comments
Closed

Hardware back button is double handled #2752

josh-griffin opened this issue Apr 22, 2020 · 3 comments
Assignees
Milestone

Comments

@josh-griffin
Copy link
Contributor

Describe the bug

Pressing the hardware backbutton is being double handled.

To reproduce

Steps to reproduce the behavior:

  1. Go to a page i.e. customer invoices page
  2. Click on the hardware back button
  3. See error [Popped two routes off the stack. If on customer invoices page, exits the app]

Expected behaviour

Should only go back once

Proposed Solution

backHandler in utilities/navigation needs to return true, which means it has handled the event, otherwise if returns a falsey value, react-navigation default kicks in (poping the stack again).

Version and device info

  • App version: 4.0.0-RC2
  • Tablet model: All
  • OS version: All

Additional context

I remember fixing this already, must have lost hte commit somehow!

@josh-griffin josh-griffin added Docs: not needed Effort: small Small effort story/task, estimated 0-2 days Priority: immediate labels Apr 22, 2020
@josh-griffin josh-griffin added this to the 5.0.0 milestone Apr 22, 2020
@wlthomson
Copy link
Contributor

@joshxg Thanks! I agree needs to go into v5.0.0 as impacts user experience pretty badly.

@wlthomson wlthomson self-assigned this Apr 22, 2020
wlthomson added a commit that referenced this issue Apr 27, 2020
…-handling-hardware-back

#2752 fix hardware back button being double handled
@wlthomson
Copy link
Contributor

Fixed by #2775.

@nishaDangol-Sussol
Copy link

TESTING

Tested in mobile version v5.0.0RC2

Tests

  • Pressing the hardware back button navigates to previous page. -PASS-

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

3 participants