Skip to content

Commit 7a0debe

Browse files
Ruslan Lekhmanlekhmanrus
authored andcommitted
fix(bottomnavigationbar): select tab native view
1 parent 52e2061 commit 7a0debe

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/bottomnavigationbar/bottomnavigationbar.android.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,13 @@ export class BottomNavigationBar extends BottomNavigationBarBase {
200200
}
201201

202202
protected selectTabNative(index: number): void {
203-
const bottomNavigationTabs = this.nativeView.getMenu();
204-
205-
if (bottomNavigationTabs.size() === 0) {
206-
return;
203+
if (this.nativeViewProtected) {
204+
const bottomNavigationTabs = this.nativeViewProtected.getMenu();
205+
if (bottomNavigationTabs.size() === 0) {
206+
return;
207+
}
208+
this.nativeViewProtected.setSelectedItemId(index);
207209
}
208-
this.nativeViewProtected.setSelectedItemId(index);
209210
this.selectedTabIndex = index;
210211
}
211212
}

0 commit comments

Comments
 (0)