-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Description
Environment
Vuetify Version: 3.11.2
Vue Version: 3.5.18
OS: macOS 10.15.7 (current)
Steps to reproduce
-
Open the Vuetify Playground: https://play.vuetifyjs.com/#...
-
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)
-
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
-
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
-
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
-
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-selectablereturnsfalsefor 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-selectablereturnsfalsefor it
This is inconsistent with the main "Select All" checkbox behavior, which correctly respects item-selectable.