ui-material-components
ui-material-components copied to clipboard
BottomNvigationBar : Tabpressed not fired on the first Item with Vue+NS+Android
Hello,
I use BottomNavigationBar with Vue.js. I set isSelectable to False to each item so that I can use the TabPressed event, the problem I found is that this event is not fired on the first item only (the two others work fine!) :
<MDBottomNavigationBar id="id_tab_nav" ref="my_tab_navigation_bottom" backgroundColor="#70152b" activeColor="#FFF" inactiveColor="#FFF" row="1" @tabPressed="tabPressedEvent" >
<MDBottomNavigationTab color="#FFF" title="Home" icon="res://home" attr-link="Home"
isSelectable="false" />
<MDBottomNavigationTab color="#FFF" title="Search" icon="res://search" attr-link="Search"
isSelectable="false" />
<MDBottomNavigationTab color="#FFF" title="User" icon="res://user" attr-link="Login"
isSelectable="false" />
</MDBottomNavigationBar>
Here is my function for the tabPressed event :
tabPressedEvent(e)
{
console.log('element=>refs',this.itemTabNavView.items);
console.log('navigateTo Item =>');
console.log(e.index);
this.$navigateTo(this.items_navs[e.index]);
}
Is there any solution to solve this problem ?
Thanks.
tabPressed is not emited if the tabs are not selectable
that's not how it is explained in the docs => " Function fired every time the user tap a tab with isSelectable: false "
Anyway, I think I found the reason : I think that the bottomTab select by default the first item then as long as it is selected the press event can't be fired.
@Echoju thanks for.pointing that out. if you can create a PR if you find the fix that would be awesome!