Skip to content

Commit

Permalink
fix(VTreeview): allow expansion of nodes when disabled
Browse files Browse the repository at this point in the history
fixes #20832
  • Loading branch information
johnleider committed Jan 20, 2025
1 parent 28ed40b commit e9e5625
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vuetify/src/labs/VTreeview/VTreeviewChildren.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export type VTreeviewChildrenSlots<T> = {
}

export const makeVTreeviewChildrenProps = propsFactory({
disabled: Boolean,
loadChildren: Function as PropType<(item: unknown) => Promise<void>>,
loadingIcon: {
type: String,
Expand Down Expand Up @@ -67,7 +68,7 @@ export const VTreeviewChildren = genericComponent<new <T extends InternalListIte
setup (props, { slots }) {
const isLoading = reactive(new Set<unknown>())

const isClickOnOpen = computed(() => props.openOnClick != null ? props.openOnClick : props.selectable)
const isClickOnOpen = computed(() => !props.disabled && (props.openOnClick != null ? props.openOnClick : props.selectable))

async function checkChildren (item: InternalListItem) {
try {
Expand Down Expand Up @@ -99,6 +100,7 @@ export const VTreeviewChildren = genericComponent<new <T extends InternalListIte
<VCheckboxBtn
key={ item.value }
modelValue={ slotProps.isSelected }
disabled={ props.disabled }
loading={ loading }
color={ props.selectedColor }
indeterminate={ slotProps.isIndeterminate }
Expand Down
3 changes: 3 additions & 0 deletions packages/vuetify/src/labs/VTreeview/VTreeviewItem.sass
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
.v-treeview
--indent-padding: 0px

&.v-list--disabled .v-list-item__prepend
pointer-events: auto

.v-treeview-group.v-list-group
--list-indent-size: #{$treeview-group-list-indent-size}

Expand Down

0 comments on commit e9e5625

Please sign in to comment.