Skip to content

Conversation

@johnleider
Copy link
Member

Summary

  • Pass listProps.density to VCheckboxBtn when rendering multiple select items
  • Fixes VSelect, VAutocomplete, and VCombobox which all share the same pattern
  • Follows precedent from VTreeviewChildren

Problem

Global defaults for listProps.density were not applied to VCheckboxBtn when using the multiple prop. The checkboxes rendered with default density while VListItem used compact density, causing visual inconsistency.

Playground for testing

<template>
  <v-app>
    <v-container>
      <v-defaults-provider
        :defaults="{
          VSelect: { listProps: { density: 'compact' } },
          VAutocomplete: { listProps: { density: 'compact' } },
          VCombobox: { listProps: { density: 'compact' } },
        }"
      >
        <v-row>
          <v-col cols="4">
            <v-select :items="['A','B','C']" label="Single" />
          </v-col>
          <v-col cols="4">
            <v-select :items="['A','B','C']" label="Multiple" multiple />
          </v-col>
        </v-row>
      </v-defaults-provider>
    </v-container>
  </v-app>
</template>

@klimekszymon
Copy link

big thank you for taking the immediate action with the issue I found!

J-Sek
J-Sek previously approved these changes Jan 13, 2026
@KaelWD
Copy link
Member

KaelWD commented Jan 14, 2026

Why not add this to

key="prepend-defaults"
disabled={ !hasPrependMedia }
defaults={{
VAvatar: {
density: props.density,
image: props.prependAvatar,
},
VIcon: {
density: props.density,
icon: props.prependIcon,
},
VListItemAction: {
start: true,
},
}}
?

Global defaults for `listProps.density` were not applied to VCheckboxBtn
when using `multiple` prop. VListItem's VDefaultsProvider was disabled
when no prependAvatar/prependIcon was set, preventing density from
flowing to slot content.

Fix by:
- Removing `disabled` condition from prepend/append VDefaultsProviders
- Adding VCheckboxBtn to the provided defaults

This is more architecturally correct than passing density explicitly
in VSelect/VAutocomplete/VCombobox, as it allows density to flow to
any VCheckboxBtn in VListItem slots.

Playground for testing:
```vue
<template>
  <v-app>
    <v-container>
      <v-defaults-provider
        :defaults="{
          VSelect: { listProps: { density: 'compact' } },
        }"
      >
        <v-row>
          <v-col cols="4">
            <v-select :items="['A','B','C']" label="Single" />
          </v-col>
          <v-col cols="4">
            <v-select :items="['A','B','C']" label="Multiple" multiple />
          </v-col>
        </v-row>
      </v-defaults-provider>
    </v-container>
  </v-app>
</template>
```
@johnleider johnleider force-pushed the fix/select-multiple-listprops-density branch from aa4cabd to 86badb8 Compare January 14, 2026 16:10
@johnleider
Copy link
Member Author

Why not add this to

key="prepend-defaults"
disabled={ !hasPrependMedia }
defaults={{
VAvatar: {
density: props.density,
image: props.prependAvatar,
},
VIcon: {
density: props.density,
icon: props.prependIcon,
},
VListItemAction: {
start: true,
},
}}

?

Updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants