Skip to content

[Bug Report][3.11.2] [v-data-table] Group header checkbox ignores item-selectable function #22409

@Leonardo-Amador

Description

@Leonardo-Amador

Environment

Vuetify Version: 3.11.2
Vue Version: 3.5.18
OS: macOS 10.15.7 (current)

Steps to reproduce

  1. Open the Vuetify Playground: https://play.vuetifyjs.com/#...

  2. Observe the initial state of the data table:

    • Group A contains 3 items: Item 1 (selectable), Item 2 (NOT selectable), Item 3 (selectable)
    • Group B contains 3 items: Item 4 (selectable), Item 5 (NOT selectable), Item 6 (NOT selectable)
  3. Test the main "Select All" checkbox behavior (works correctly):

    • Click the "Select All" checkbox in the table header
    • Note that only 3 items are selected: Item 1, Item 3, and Item 4
    • Items 2, 5, and 6 remain unselected because they have selectable set to false
    • This is the correct behavior
    • Unselect all items before proceeding
  4. Test the group header checkbox behavior (does not work correctly):

    • Click the checkbox in the "Group A" header
    • Note that ALL 3 items in Group A are selected, including Item 2
    • Item 2 should not be selected because item-selectable returns false for it
    • Expected behavior: Only Item 1 and Item 3 should be selected
  5. Verify the same issue occurs with Group B:

    • Click the checkbox in the "Group B" header
    • Note that ALL 3 items in Group B are selected, including Items 5 and 6
    • Items 5 and 6 should not be selected
    • Expected behavior: Only Item 4 should be selected
  6. Conclusion:

    • The group header checkboxes ignore the item-selectable function
    • The main "Select All" checkbox correctly respects the item-selectable function
    • This creates an inconsistent user experience

Expected Behavior

When clicking the checkbox in a group header, only items where item-selectable returns true should be selected, matching the behavior of the main "Select All" checkbox in the table header.

In the reproduction example:

  • Clicking "Group A" checkbox should select only Item 1 and Item 3 (2 items)
  • Item 2 should remain unselected because item-selectable returns false for it

Actual Behavior

When clicking the checkbox in a group header, ALL items in that group are selected, regardless of the item-selectable function result.

In the reproduction example:

  • Clicking "Group A" checkbox selects Item 1, Item 2, and Item 3 (all 3 items)
  • Item 2 is incorrectly selected even though item-selectable returns false for it

This is inconsistent with the main "Select All" checkbox behavior, which correctly respects item-selectable.

Metadata

Metadata

Assignees

Labels

C: VDataTableT: bugFunctionality that does not work as intended/expected

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions