React-native-navigation: [V2] [Android] Back button does not work as expected on screen with side menus

Created on 4 Aug 2018  ·  5Comments  ·  Source: wix/react-native-navigation

Back button does not work as expected on screen with side menus

if a screen gets pushed in an app with side menu, pressing back button does not pop the last screen from stack. It exits from the app completely. Does not depend on how many screens are pushed.

Steps to Reproduce / Code Snippets / Screenshots

Run the playground app.
press "SWITCH TO APP WITH SIDE MENUS".
Press "Push".
Press back button.
It exits the app.

the screen cap


Environment

  • React Native Navigation version: 2.0.2453
  • React Native version: 0.51.x
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Google Pixel 1/ 8.1 / Debug
Android acceptebug v2

Most helpful comment

Resolved in 2.0.2553
Now hardware back button will close open side menus or let the center view handle the back press.

All 5 comments

@guyca @yogevbd Is there any workaround on this issue?
RNN Version: 2.0.2478

You could listen to navigation events on that screen for back button presses and call the pop method.

Resolved in 2.0.2553
Now hardware back button will close open side menus or let the center view handle the back press.

Thanks for this fix @guyca. Works great for us.

Resolved in 2.0.2553
Now hardware back button will close open side menus or let the center view handle the back press.

I can't say thank you enough.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

charlesluo2014 picture charlesluo2014  ·  3Comments

birkir picture birkir  ·  3Comments

switchtrue picture switchtrue  ·  3Comments

bdrobinson picture bdrobinson  ·  3Comments

kiroukou picture kiroukou  ·  3Comments