Repository navigation
[Bug Report][3.9.7] Selection is not functioning correctly in the group-header slot of the Data Table component. #22014
Copy link
Copy link
Closed as duplicate
Closed as duplicate
Copy link
Labels
C: VDataTableT: featureA new featureA new featureduplicateThe issue has already been reportedThe issue has already been reported
Description
Environment
Vuetify Version: 3.9.7
Vue Version: 3.5.21
OS: macOS 10.15 (current)
Steps to reproduce
- Use the v-data-table component.
- Add a custom component or markup to the #group-header slot.
- Add a checkbox component or an HTML input element, along with a group label.
- Use slot scope props to implement the selection logic.
Expected Behavior
- The "Select all" checkbox in the header should select all groups, subgroups and items.
- Selecting top group should select all subgroups and items or selecting subgroup should select its all subgroups and items.
Actual Behavior
The component can select either individual groups and items or only root groups and items.
Reproduction Link
https://play.vuetifyjs.com/#...
Images
Reproduction source code
Code to reproduce
<template>
<v-data-table
v-model="selected"
:group-by="groupBy"
:items="items"
item-value="name"
show-select
>
<template #group-header="{item, isSelected, toggleGroup, toggleSelect}">
<tr>
<td colspan="10">
<div
class="d-flex align-center"
:style="{paddingLeft: `${item.depth * 16}px`} "
>
<v-checkbox-btn
:model-value="isSelected(item)"
@click="toggleSelect(!isSelected(item))"
style="flex: 0 auto"
/>
<span>{{item.value}}</span>
<v-btn
density="compact"
variant="flat"
@click="toggleGroup(item)"
color="primary"
>toggle</v-btn
>
</div>
</td>
</tr>
</template>
</v-data-table>
</template>
<script>
export default {
data () {
return {
selected: [],
groupBy: [
{ key: 'name', order: 'asc' },
{ key: 'location', order: 'asc' },
],
items: [
{
name: '🍎 Apple',
location: 'Washington',
height: '0.1',
base: '0.07',
volume: '0.0001',
},
{
name: '🍌 Banana',
location: 'Ecuador',
height: '0.2',
base: '0.05',
volume: '0.0002',
},
{
name: '🍇 Grapes',
location: 'Italy',
height: '0.02',
base: '0.02',
volume: '0.00001',
},
{
name: '🍉 Watermelon',
location: 'China',
height: '0.4',
base: '0.3',
volume: '0.03',
},
{
name: '🍍 Pineapple',
location: 'Thailand',
height: '0.3',
base: '0.2',
volume: '0.005',
},
{
name: '🍒 Cherries',
location: 'Turkey',
height: '0.02',
base: '0.02',
volume: '0.00001',
},
{
name: '🥭 Mango',
location: 'India',
height: '0.15',
base: '0.1',
volume: '0.0005',
},
{
name: '🍓 Strawberry',
location: 'USA',
height: '0.03',
base: '0.03',
volume: '0.00002',
},
{
name: '🍑 Peach',
location: 'China',
height: '0.09',
base: '0.08',
volume: '0.0004',
},
{
name: '🥝 Kiwi',
location: 'New Zealand',
height: '0.05',
base: '0.05',
volume: '0.0001',
},
],
}
},
}
</script>Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C: VDataTableT: featureA new featureA new featureduplicateThe issue has already been reportedThe issue has already been reported

Activity
jcjp commentedon Sep 6, 2025
In my opinion treeview component is a better alternative to your use case, look here: https://vuetifyjs.com/en/components/treeview/#selectable-icons.
rustem-nasyrov commentedon Oct 13, 2025
@jcjp, nope. I needed a data table. If I wanted to use the tree view component, I’d be using that instead. :)
J-Sek commentedon Oct 14, 2025
I don't think it is supported at all. Hope you are up for a tough fight against the framework.
rustem-nasyrov commentedon Oct 15, 2025
I do. :')