mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: stabilize iOS13 unit tests (#8127)
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user