Skip to content

Commit

Permalink
fix(VTreeview): independent selection inheriting parent state (#14956)
Browse files Browse the repository at this point in the history
fixes #14955

Co-authored-by: Thomas Kientz <thomas@kientz.fr>
Co-authored-by: Kael <kaelwd@gmail.com>
  • Loading branch information
3 people committed Apr 21, 2022
1 parent a427b96 commit 2034df6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/vuetify/src/components/VTreeview/VTreeview.ts
Expand Up @@ -217,7 +217,12 @@ export default mixins(
this.buildTree(children, key)

// This fixed bug with dynamic children resetting selected parent state
if (!this.nodes.hasOwnProperty(key) && parent !== null && this.nodes.hasOwnProperty(parent)) {
if (
this.selectionType !== 'independent' &&
parent !== null &&
!this.nodes.hasOwnProperty(key) &&
this.nodes.hasOwnProperty(parent)
) {
node.isSelected = this.nodes[parent].isSelected
} else {
node.isSelected = oldNode.isSelected
Expand Down

0 comments on commit 2034df6

Please sign in to comment.