Skip to content

Commit a85c676

Browse files
authored
Merge pull request #236 from PackagedCat/master
fix: default tab select on iOS
2 parents cc55c21 + 984f648 commit a85c676

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/bottomnavigationbar/bottomnavigationbar-common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export abstract class BottomNavigationBarBase extends View {
114114
}
115115

116116
_addChildFromBuilder(name: string, value: BottomNavigationTabBase): void {
117-
if (name === 'BottomNavigationTab') {
117+
if (value instanceof BottomNavigationTabBase) {
118118
if (!this._items) {
119119
this._items = [];
120120
}

src/bottomnavigationbar/bottomnavigationbar.ios.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,10 @@ export class BottomNavigationBar extends BottomNavigationBarBase {
152152
return tab;
153153
});
154154
this.nativeViewProtected.items = new NSArray({ array: bottomNavigationTabs });
155+
155156
// TODO: this is for he v8 runtime. Should not have to need this setTimeout(), find better way.
156157
setTimeout(() => {
157-
this.nativeViewProtected.selectedItem = this.nativeViewProtected.items.objectAtIndex(this.selectedTabIndex);
158+
this.nativeViewProtected.selectedItem = this.nativeViewProtected.items[this.selectedTabIndex];
158159
}, 0);
159160
}
160161

0 commit comments

Comments
 (0)