mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-06 22:39:41 +08:00
Fix focus events in native stack on Android. (#292)
This change fixes the issue with auto focusing text input fields inside native stack. Due to the fact we perform hide and show transactions in order to control back stack the hiding part would propagate visibility change event down the view hierarchy. As a result views would receive that visibility event and blur themselves resulting in textinput not getting the focus when the fragment mounts. It turns out however that for the back stack to function properly we don't need to run hide and show operation within the transaction because show is idempotent. So we change our back stack handling transaction to only call show.
This commit is contained in:
committed by
GitHub
parent
1c7ebeba39
commit
f044334464
@@ -243,7 +243,6 @@ public class ScreenStack extends ScreenContainer<ScreenStackFragment> {
|
||||
if (topScreen != firstScreen && topScreen.isDismissable()) {
|
||||
mFragmentManager
|
||||
.beginTransaction()
|
||||
.hide(topScreen)
|
||||
.show(topScreen)
|
||||
.addToBackStack(BACK_STACK_TAG)
|
||||
.setPrimaryNavigationFragment(topScreen)
|
||||
|
||||
Reference in New Issue
Block a user