Skip to content

Commit

Permalink
chore: remove selectable from the concern of this PR
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwu9145 committed May 12, 2024
1 parent 52385b1 commit b09290c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VList/VListItem.tsx
Expand Up @@ -34,7 +34,7 @@ import { deprecate, EventProp, genericComponent, propsFactory, useRender } from
import type { PropType } from 'vue'
import type { RippleDirectiveBinding } from '@/directives/ripple'

type ListItemSlot = {
export type ListItemSlot = {
isActive: boolean
isSelected: boolean
isIndeterminate: boolean
Expand Down
14 changes: 5 additions & 9 deletions packages/vuetify/src/labs/VTreeview/VTreeviewItem.tsx
Expand Up @@ -20,7 +20,7 @@ import { genericComponent, propsFactory, useRender } from '@/util'
// Types
import { VTreeviewSymbol } from './shared'
import { VProgressCircular } from '../allComponents'
import type { VListItemSlots } from '@/components/VList/VListItem'
import type { ListItemSlot, VListItemSlots } from '@/components/VList/VListItem'

export const makeVTreeviewItemProps = propsFactory({
loading: Boolean,
Expand Down Expand Up @@ -51,7 +51,7 @@ export const VTreeviewItem = genericComponent<VListItemSlots>()({
} = useNestedItem(id, false)

const isActivetableGroupActivator = computed(() =>
(root.activatable.value || root.selectable.value) &&
(root.activatable.value) &&
isGroupActivator &&
!props.openOnClick
)
Expand All @@ -63,7 +63,7 @@ export const VTreeviewItem = genericComponent<VListItemSlots>()({
select,
isSelected: isSelected.value,
isIndeterminate: isIndeterminate.value,
} satisfies any))
} satisfies ListItemSlot))

const isClickable = computed(() =>
!props.disabled &&
Expand All @@ -83,12 +83,8 @@ export const VTreeviewItem = genericComponent<VListItemSlots>()({
} else {
vListItemRef.value?.activate(!vListItemRef.value?.isActivated, e)
}
} else if (root.selectable.value) {
if (isActivetableGroupActivator.value) {
select(!isSelected.value, e)
} else {
vListItemRef.value?.select(!vListItemRef.value?.isSelected, e)
}
} else if (props.value != null) {
vListItemRef.value?.select(!vListItemRef.value?.isSelected, e)
}
}

Expand Down

0 comments on commit b09290c

Please sign in to comment.