mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(ios): ios 10 tab crash (#9018)
* Fix: ios10 tab crash * Fix iOS 14 tests that crash because of changes in the way ios 14 works.
This commit is contained in:
committed by
GitHub
parent
c569236357
commit
b3f9c0d0ac
@@ -1119,16 +1119,31 @@ export class Tabs extends TabsBase {
|
||||
// do not make layout changes while the animation is in progress https://stackoverflow.com/a/47031524/613113
|
||||
this.visitFrames(item, (frame) => (frame._animationInProgress = true));
|
||||
|
||||
const doneAnimating = () => {
|
||||
this.visitFrames(item, (frame) => (frame._animationInProgress = false));
|
||||
|
||||
this._canSelectItem = true;
|
||||
this._setCanBeLoaded(value);
|
||||
this._loadUnloadTabItems(value);
|
||||
};
|
||||
|
||||
invokeOnRunLoop(() =>
|
||||
this.viewController.setViewControllersDirectionAnimatedCompletion(controllers, navigationDirection, this.animationEnabled, (finished: boolean) => {
|
||||
this.visitFrames(item, (frame) => (frame._animationInProgress = false));
|
||||
if (finished) {
|
||||
// HACK: UIPageViewController fix; see https://stackoverflow.com/a/17330606
|
||||
invokeOnRunLoop(() => this.viewController.setViewControllersDirectionAnimatedCompletion(controllers, navigationDirection, false, null));
|
||||
if (this.animationEnabled) {
|
||||
// HACK: UIPageViewController fix; see https://stackoverflow.com/a/17330606
|
||||
// Prior Hack fails on iOS 10.3 during tests with v8 engine...
|
||||
// Leaving the above link in case we need to special case this for only iOS > 10.3?
|
||||
|
||||
this._canSelectItem = true;
|
||||
this._setCanBeLoaded(value);
|
||||
this._loadUnloadTabItems(value);
|
||||
// HACK: UIPageViewController fix; see https://stackoverflow.com/questions/15325891
|
||||
invokeOnRunLoop(() => {
|
||||
this.viewController.dataSource = null;
|
||||
(<any>this.viewController).dataSource = this.viewController;
|
||||
doneAnimating();
|
||||
});
|
||||
} else {
|
||||
doneAnimating();
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user