mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(tabs): delay loadView when animation runs
This commit is contained in:
@@ -1091,7 +1091,18 @@ export class Tabs extends TabsBase {
|
||||
}
|
||||
|
||||
this._currentNativeSelectedIndex = value;
|
||||
|
||||
let itemControllerOwner = null;
|
||||
if (itemController._owner) {
|
||||
let itemControllerOwner = <Frame>itemController._owner.get();
|
||||
// do not load new views while the animation is in progress https://stackoverflow.com/a/47031524/613113
|
||||
itemControllerOwner._animationInProgress = true;
|
||||
}
|
||||
|
||||
this.viewController.setViewControllersDirectionAnimatedCompletion(controllers, navigationDirection, true, (finished: boolean) => {
|
||||
if (itemControllerOwner) {
|
||||
itemControllerOwner._animationInProgress = false;
|
||||
}
|
||||
if (finished) {
|
||||
// HACK: UIPageViewController fix; see https://stackoverflow.com/a/17330606
|
||||
invokeOnRunLoop(() => this.viewController.setViewControllersDirectionAnimatedCompletion(controllers, navigationDirection, false, null));
|
||||
|
||||
Reference in New Issue
Block a user