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:
Krzysztof Magiera
2020-01-22 15:19:54 +01:00
committed by GitHub
parent 1c7ebeba39
commit f044334464

View File

@@ -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)