Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(list-items): don't remove external value reactivity #20997

Closed
wants to merge 1 commit into from

Conversation

johnleider
Copy link
Member

fixes #20992

doesn't appear to break #20937

Description

Markup:

<template>
  <v-app>
    <v-container>
      <v-autocomplete
        v-model="selectedItems"
        :items="items"
        label="test"
        multiple
      >
        <template #prepend-item>
          <v-list-item @click="selectAll()">
            <v-list-item-title> Select all </v-list-item-title>
          </v-list-item>
        </template>
        <template #selection="{ item, index }">
          <template v-if="selectedItems.length > 5">
            <span v-if="!index">{{ selectedItems.length }}</span>
          </template>
          <template v-else>
            <span v-if="index" class="hint mr-1"> or </span>
            <v-chip
              :style="{ height: '24px' }"
              size="small"
              variant="flat"
              label
            >
              {{ item.title }}
            </v-chip>
          </template>
        </template>
      </v-autocomplete>
    </v-container>
  </v-app>
</template>

<script setup>
  import { ref } from 'vue'

  const selectedItems = ref([])
  const items = Array.from({ length: 10000 }, (_, i) => ({ title: `Item ${i}`, value: i }))

  function selectAll () {
    selectedItems.value =
      items.length === selectedItems.value.length ? [] : items.map(c => c.value)
  }
</script>

@johnleider johnleider added T: bug Functionality that does not work as intended/expected P: critical The issue is of critical importance T: regression Something that used to work but we broke C: VSelect C: VAutocomplete labels Feb 18, 2025
@johnleider johnleider self-assigned this Feb 18, 2025
@johnleider johnleider force-pushed the fix/20992-list-items-transform branch from aefbe93 to bcf306e Compare February 18, 2025 15:49
@johnleider johnleider requested a review from KaelWD February 18, 2025 15:50
@johnleider johnleider force-pushed the fix/20992-list-items-transform branch from bcf306e to d7cab8c Compare February 18, 2025 21:21
@KaelWD KaelWD closed this in 4df71de Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VAutocomplete C: VSelect P: critical The issue is of critical importance T: bug Functionality that does not work as intended/expected T: regression Something that used to work but we broke
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report][3.7.12] Autocomplete does not watch v-model
1 participant