From b46bd00ffb289a44fcf8c5c8ad68d8766770b0ec Mon Sep 17 00:00:00 2001 From: J-Sek Date: Thu, 16 Oct 2025 16:34:22 +0200 Subject: [PATCH 1/2] feat(VList): default to semantic tags --- packages/vuetify/src/components/VList/VList.tsx | 3 ++- .../vuetify/src/components/VList/VListChildren.tsx | 11 ++++++++++- packages/vuetify/src/components/VList/VListGroup.tsx | 12 ++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/packages/vuetify/src/components/VList/VList.tsx b/packages/vuetify/src/components/VList/VList.tsx index 8a449d244fb..7414c4b6429 100644 --- a/packages/vuetify/src/components/VList/VList.tsx +++ b/packages/vuetify/src/components/VList/VList.tsx @@ -120,7 +120,7 @@ export const makeVListProps = propsFactory({ ...makeElevationProps(), ...makeItemsProps(), ...makeRoundedProps(), - ...makeTagProps(), + ...makeTagProps({ tag: 'ul' }), ...makeThemeProps(), ...makeVariantProps({ variant: 'text' } as const), }, 'VList') @@ -288,6 +288,7 @@ export const VList = genericComponent = { @@ -26,12 +27,14 @@ export type VListChildrenSlots = { } export const makeVListChildrenProps = propsFactory({ + groupTag: [String, Object, Function] as PropType, items: Array as PropType, returnObject: Boolean, }, 'VListChildren') export const VListChildren = genericComponent( props: { + groupTag?: TagProps['tag'] items?: readonly T[] returnObject?: boolean }, @@ -64,10 +67,14 @@ export const VListChildren = genericComponent( title: slots.title ? (slotProps: any) => slots.title?.({ ...slotProps, item }) : undefined, } + const childrenTag = toRef(() => props.groupTag === 'ol' || props.groupTag === 'ul' ? 'li' : undefined) + const listGroupProps = VListGroup.filterProps(itemProps) return children ? ( ( }, default: () => ( ( ) : ( slots.item ? slots.item({ props: itemProps }) : ( } @@ -31,6 +35,10 @@ const VListGroupActivator = defineComponent({ }) export const makeVListGroupProps = propsFactory({ + groupTag: { + type: [String, Object, Function] as PropType, + default: 'div', + }, /* @deprecated */ activeColor: String, baseColor: String, @@ -114,9 +122,9 @@ export const VListGroup = genericComponent()({ )} -
+ { slots.default?.() } -
+
)) From 4acd89db89bc2d59fb5ba4b154ae5ac1aa43f242 Mon Sep 17 00:00:00 2001 From: J-Sek Date: Thu, 16 Oct 2025 16:42:03 +0200 Subject: [PATCH 2/2] fix: keep VTreeview with `div` --- packages/vuetify/src/components/VTreeview/VTreeview.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/vuetify/src/components/VTreeview/VTreeview.tsx b/packages/vuetify/src/components/VTreeview/VTreeview.tsx index d9d5c42f193..0ef70911f23 100644 --- a/packages/vuetify/src/components/VTreeview/VTreeview.tsx +++ b/packages/vuetify/src/components/VTreeview/VTreeview.tsx @@ -162,6 +162,7 @@ export const VTreeview = genericComponent(