Skip to content

Commit

Permalink
fix(VTreeview): properly indent nodes
Browse files Browse the repository at this point in the history
fixes #20421
  • Loading branch information
johnleider committed Jan 20, 2025
1 parent 7abcca1 commit 28ed40b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
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 @@ -16,3 +16,6 @@

.v-list-group__items .v-list-item
padding-inline-start: calc(#{$treeview-item-padding-inline-start} + var(--indent-padding)) !important

.v-list-group__items .v-list-item.v-list-group__header
padding-inline-start: calc(#{$treeview-group-header-padding-inline-start} + var(--indent-padding)) !important
46 changes: 23 additions & 23 deletions packages/vuetify/src/labs/VTreeview/VTreeviewItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,29 +80,29 @@ export const VTreeviewItem = genericComponent<VListItemSlots>()({
prepend: hasPrepend ? slotProps => {
return (
<>
{ props.toggleIcon && (
<VListItemAction start={ false }>
<VBtn
density="compact"
icon={ props.toggleIcon }
loading={ props.loading }
variant="text"
onClick={ props.onToggleExpand }
>
{{
loader () {
return (
<VProgressCircular
indeterminate="disable-shrink"
size="20"
width="2"
/>
)
},
}}
</VBtn>
</VListItemAction>
)}
<VListItemAction start={ false }>
{ props.toggleIcon && (
<VBtn
density="compact"
icon={ props.toggleIcon }
loading={ props.loading }
variant="text"
onClick={ props.onToggleExpand }
>
{{
loader () {
return (
<VProgressCircular
indeterminate="disable-shrink"
size="20"
width="2"
/>
)
},
}}
</VBtn>
)}
</VListItemAction>

{ slots.prepend?.(slotProps) }
</>
Expand Down
1 change: 1 addition & 0 deletions packages/vuetify/src/labs/VTreeview/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ $treeview-group-list-indent-size: 16px !default;
$treeview-group-list-prepend-width: 16px !default;
$treeview-item-padding-inline-start: 12px !default;
$treeview-item-prepend-padding-inline-start: 44px !default;
$treeview-group-header-padding-inline-start: 16px !default;

0 comments on commit 28ed40b

Please sign in to comment.