Skip to content

Conversation

@Haviles04
Copy link
Contributor

@Haviles04 Haviles04 commented Dec 6, 2025

resolves #22400

Markup

<template>
  <v-app theme="dark">
    <v-container class="d-flex align-center ga-3" max-width="600">
      <v-toolbar>
        <div class="d-flex ga-3 justify-space-evenly w-100">
          <v-switch v-model="headerEnabled" label="header" hide-details />
          <v-switch v-model="footerEnabled" label="footer" hide-details />
          <v-switch v-model="forceNoData" label="no-data" hide-details />
        </div>
      </v-toolbar>
    </v-container>

    <v-container class="d-flex align-center ga-3" max-width="600">
      <v-btn text="btn before" />
      <v-select
        v-model="selectedItems"
        v-model:menu="menu1"
        :items="forceNoData ? [] : items"
        class="rounded-lg"
        item-title="value"
        label="header + footer"
        hide-details
        multiple
      >
        <template v-if="headerEnabled" #list-header>
          <div class="pa-2 border-b">
            <v-text-field
              append-icon="$close"
              density="compact"
              prepend-inner-icon="mdi-magnify"
              hide-details
              @click:append="menu1 = false"
            />
          </div>
        </template>
        <template v-if="footerEnabled" #list-footer>
          <div class="d-flex justify-space-between pa-2 border-t">
            <v-btn prepend-icon="$prev" text="prev" variant="text" />
            <v-btn append-icon="$next" text="next" variant="text" />
          </div></template>
      </v-select>
      <v-btn text="btn after" />
    </v-container>
  </v-app>
</template>

<script setup>
  import { shallowRef } from 'vue'
  const menu1 = shallowRef(false)
  const footerEnabled = shallowRef(false)
  const headerEnabled = shallowRef(false)
  const forceNoData = shallowRef(false)
  const selectedItems = shallowRef([])
  const items = Array.from({ length: 215 }, (_, i) => ({ id: i, value: i * 10 }))
</script>

@J-Sek

This comment was marked as resolved.

@J-Sek J-Sek added T: feature A new feature C: VSelect labels Dec 6, 2025
@Haviles04 Haviles04 marked this pull request as ready for review December 8, 2025 16:20
@Haviles04 Haviles04 requested a review from J-Sek December 8, 2025 17:35
@Haviles04 Haviles04 changed the title feat: add list-header slot feat:(V-Select) add list-header slot Dec 8, 2025
@Haviles04 Haviles04 changed the title feat:(V-Select) add list-header slot feat:(VSelect) add list-header slot Dec 8, 2025
@Haviles04 Haviles04 changed the title feat:(VSelect) add list-header slot feat(VSelect): Add list-header slot Dec 8, 2025
@J-Sek

This comment was marked as resolved.

@Haviles04 Haviles04 force-pushed the haviles04/v-select-header-slot branch from f04f492 to 38c8d07 Compare December 11, 2025 00:14
@Haviles04

This comment was marked as outdated.

@J-Sek J-Sek changed the base branch from master to dev December 21, 2025 14:51
@J-Sek J-Sek force-pushed the haviles04/v-select-header-slot branch from ec6f80a to c8acf89 Compare December 21, 2025 14:54
@J-Sek
Copy link
Contributor

J-Sek commented Dec 22, 2025

arrowDown will not act like tab when triggered in header/footer slots. This is exclusive feature of VList and a way to move focus from the input, but it brings more confusion when used elswhere

focus('last') in a virtualized list does not work (even without those changes) - try focusing VSelect without any slots and click ArrowUp to open the menu. When the list exceeds few hundreds, it lands at the last item rendered by virtual scroller. Better to push it as a future enhancement as it is just a minor inconvenience. Ideally, we would re-focus last focused item.

@J-Sek J-Sek added this to the v3.12.0 milestone Dec 22, 2025
@J-Sek J-Sek force-pushed the haviles04/v-select-header-slot branch from 088726f to 6f7531b Compare December 22, 2025 13:04
@Haviles04 Haviles04 requested a review from johnleider January 3, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] VSelect - header/footer slots in the dropdown menu

3 participants