question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues with Android's hardware back button with Tabs

See original GitHub issue

Version

Tell us which versions you are using:

  • react-native-router-flux 4.0.0-beta.27 (v3 is not supported)
  • react-native 0.54.0

Expected behaviour

When navigating to a Scene outside of Tabs from within tabs and then pressing the hardware back button, you should then be navigated back to the previous scene within tabs.

Actual behaviour

When navigating to a scene outside of tabs from within tabs and then pressing the hardware back button it navigates you to the last visited page outside of tabs. Ignoring the scene within tabs which was previously visited.

Steps to reproduce

For non-obvious bugs, please fork this component, modify Example project to reproduce your issue and include link here.

  1. Create a similar router to the example below
  2. Navigate to page_2
  3. Then navigate to page_3
  4. Press hardware back button
  5. You will end up on page_1

Minimal example router:

<Router>
    <Drawer key={'root'} contentComponent={...}>
        <Scene key={'page_1'} initial={true} component={...}/>
        <Scene key={'page_3'} component={...}/>

        <Tabs>
            <Scene key={'page_2'} component={...}/>
        </Tabs>
    </Drawer>
</Router>

Edit: Now seeing the same issues on react-native-router-flux 4.0.2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
daviscabralcommented, Aug 23, 2018

Check the Example, it’s working there 👍

2018-08-23 06 58 45

0reactions
daviscabralcommented, Sep 12, 2018

I believe a custom reducer also can make it work without needing to change the lib. I am inclined to close this issue since the lib is flexible enough to allow a proper fix. What do you think?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why are my menu buttons (home, search, back buttons) not ...
First of all restart your android phone or tablet. If not solve then try below solutions. Fix home button not working android Nougat, ......
Read more >
Tab issue in android with back button - Stack Overflow
Hi Selva, I got the Idea, but don't knw how the TabBar is showing error in my activity, Is I need to extends...
Read more >
Hardware Back Button for Capacitor & Cordova on Android ...
The hardware back button is found on most Android devices. Read to learn more about hardware back button use in Capacitor and Cordova...
Read more >
Android back button and tabs - UX Stack Exchange
It makes the user completely lose the feeling of what he/she has in front of him/her, spoiling every chance to ever get it....
Read more >
Leaving Tor Browser with back button closes all tabs
When you load a new tab from an external app, then close it with back button, it closes all tabs. It should only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found