I'm trying to deselect the v-tabs component through code but it always ends up selecting the first tab.
When the v-model is set to -1 it's deselected on init but once any tab has been selected there seems to be no way to deselect. Any other value than one of the tabs will just select the first tab and set the index to 0. (v-model and value have the same result)
Here is a CodePen example: https://codepen.io/arno-van-oordt/pen/qBBbmzY
- The index starts at -1
- Click tab 2 or 3 on either of the tab bars
- Click "Deselect"
HTML:
<div id="app">
<v-app id="inspire">
tabIndex: {{tabIndex}}
<v-tabs :value="tabIndex">
<v-tab>Item One</v-tab>
<v-tab>Item Two</v-tab>
<v-tab>Item Three</v-tab>
</v-tabs>
<v-tabs v-model="tabIndex">
<v-tab>Item One</v-tab>
<v-tab>Item Two</v-tab>
<v-tab>Item Three</v-tab>
</v-tabs>
<v-btn @click="deselect">Deselect</v-btn>
</v-app>
</div>
JS:
new Vue({
el: "#app",
vuetify: new Vuetify(),
data: {
tabIndex: -1
},
methods: {
deselect: function() {
this.tabIndex = -1;
}
}
});
Is this a bug or am I missing something here?