Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tabs-ios): crash when setting tabStripItems through items property #7548

Merged
merged 2 commits into from
Jul 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions tns-core-modules/ui/tabs/tabs.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,11 @@ export class Tabs extends TabsBase {

this._ios.dataSource = this._dataSource;
this._ios.delegate = this._delegate;

if (!this.tabBarItems) {
const tabStripItems = this.tabStrip ? this.tabStrip.items : null;
this.setTabStripItems(tabStripItems);
}
}

public onUnloaded() {
Expand Down Expand Up @@ -836,6 +841,10 @@ export class Tabs extends TabsBase {
}

public setTabStripItems(items: Array<TabStripItem>) {
if (!this.tabStrip || !items) {
return;
}

const tabBarItems = [];

items.forEach((item: TabStripItem, i) => {
Expand Down