Skip to content

Commit 994b52a

Browse files
committed
fix: merge fix from N Core
NativeScript/NativeScript@b3f9c0d
1 parent 7053eb1 commit 994b52a

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

src/tabs/tabs.ios.ts

+22-7
Original file line numberDiff line numberDiff line change
@@ -1106,16 +1106,31 @@ export class Tabs extends TabsBase {
11061106
// do not make layout changes while the animation is in progress https://stackoverflow.com/a/47031524/613113
11071107
this.visitFrames(item, (frame) => (frame._animationInProgress = true));
11081108

1109+
const doneAnimating = () => {
1110+
this.visitFrames(item, (frame) => (frame._animationInProgress = false));
1111+
1112+
this._canSelectItem = true;
1113+
this._setCanBeLoaded(value);
1114+
this._loadUnloadTabItems(value);
1115+
};
1116+
11091117
invokeOnRunLoop(() =>
11101118
this.viewController.setViewControllersDirectionAnimatedCompletion(controllers, navigationDirection, this.animationEnabled, (finished: boolean) => {
1111-
this.visitFrames(item, (frame) => (frame._animationInProgress = false));
11121119
if (finished) {
1113-
// HACK: UIPageViewController fix; see https://stackoverflow.com/a/17330606
1114-
invokeOnRunLoop(() => this.viewController.setViewControllersDirectionAnimatedCompletion(controllers, navigationDirection, false, null));
1115-
1116-
this._canSelectItem = true;
1117-
this._setCanBeLoaded(value);
1118-
this._loadUnloadTabItems(value);
1120+
if (this.animationEnabled) {
1121+
// HACK: UIPageViewController fix; see https://stackoverflow.com/a/17330606
1122+
// Prior Hack fails on iOS 10.3 during tests with v8 engine...
1123+
// Leaving the above link in case we need to special case this for only iOS > 10.3?
1124+
1125+
// HACK: UIPageViewController fix; see https://stackoverflow.com/questions/15325891
1126+
invokeOnRunLoop(() => {
1127+
this.viewController.dataSource = null;
1128+
(this.viewController as any).dataSource = this.viewController;
1129+
doneAnimating();
1130+
});
1131+
} else {
1132+
doneAnimating();
1133+
}
11191134
}
11201135
})
11211136
);

0 commit comments

Comments
 (0)