chore: stabilize iOS13 unit tests (#8127)

This commit is contained in:
Manol Donev
2019-11-21 16:50:31 +02:00
committed by GitHub
parent 800f5bcfe4
commit 786aca3039
5 changed files with 28 additions and 19 deletions

View File

@@ -542,7 +542,11 @@ export class TabView extends TabViewBase {
public _loadUnloadTabItems(newIndex: number) {
const items = this.items;
const lastIndex = this.items.length - 1;
if (!items) {
return;
}
const lastIndex = items.length - 1;
const offsideItems = this.androidTabsPosition === "top" ? this.androidOffscreenTabLimit : 1;
let toUnload = [];

View File

@@ -465,7 +465,11 @@ export class Tabs extends TabsBase {
public _loadUnloadTabItems(newIndex: number) {
const items = this.items;
const lastIndex = this.items.length - 1;
if (!items) {
return;
}
const lastIndex = items.length - 1;
const offsideItems = this.offscreenTabLimit;
let toUnload = [];

View File

@@ -636,7 +636,11 @@ export class Tabs extends TabsBase {
public _loadUnloadTabItems(newIndex: number) {
const items = this.items;
const lastIndex = this.items.length - 1;
if (!items) {
return;
}
const lastIndex = items.length - 1;
const offsideItems = this.offscreenTabLimit;
let toUnload = [];
@@ -768,6 +772,10 @@ export class Tabs extends TabsBase {
public _setCanBeLoaded(index: number) {
const items = this.items;
if (!this.items) {
return;
}
const lastIndex = items.length - 1;
const offsideItems = this.offscreenTabLimit;
@@ -1085,10 +1093,8 @@ export class Tabs extends TabsBase {
this._currentNativeSelectedIndex = value;
this.viewController.setViewControllersDirectionAnimatedCompletion(controllers, navigationDirection, true, (finished: boolean) => {
if (finished) {
if (majorVersion < 10) {
// HACK: UIPageViewController fix; see https://stackoverflow.com/a/17330606
invokeOnRunLoop(() => this.viewController.setViewControllersDirectionAnimatedCompletion(controllers, navigationDirection, false, null));
}
// HACK: UIPageViewController fix; see https://stackoverflow.com/a/17330606
invokeOnRunLoop(() => this.viewController.setViewControllersDirectionAnimatedCompletion(controllers, navigationDirection, false, null));
this._canSelectItem = true;
this._setCanBeLoaded(value);