Skip to content

Commit 27773e9

Browse files
author
Hristo Hristov
authored
Initial transitions are ingored on android (as they are on ios) because on API 21+ Transition class requires at least one layout pass before transitions are executed. If we don't ignore it our transition handlers won't execute and frame navigation won't execute because it thinks there is a pending navigation. (NativeScript#4896)
Fix NativeScript#4895
1 parent 9b52bbc commit 27773e9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tns-core-modules/ui/frame/frame.android.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,11 @@ export class Frame extends FrameBase {
140140
const fragmentTransaction = manager.beginTransaction();
141141

142142
const animated = this._getIsAnimatedNavigation(backstackEntry.entry);
143-
const navigationTransition = this._getNavigationTransition(backstackEntry.entry);
143+
// NOTE: Don't use transition for the initial nagivation (same as on iOS)
144+
//. On API 21+ transition won't be triggered unless there was at least one
145+
// layout pass so we will wait forever for transitionCompleted handler...
146+
// https://github.com/NativeScript/NativeScript/issues/4895
147+
const navigationTransition = this._currentEntry ? this._getNavigationTransition(backstackEntry.entry) : null;
144148

145149
_setAndroidFragmentTransitions(animated, navigationTransition, currentFragment, newFragment, fragmentTransaction, manager);
146150
if (currentFragment) {

0 commit comments

Comments
 (0)