Issues with Android's hardware back button with Tabs
See original GitHub issueVersion
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.
- Create a similar router to the example below
- Navigate to
page_2
- Then navigate to
page_3
- Press hardware back button
- 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:
- Created 5 years ago
- Comments:15 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Check the Example, it’s working there 👍
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?