-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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(VAutocomplete): only clear search on blur in multiple mode or using chips/selection shots #19701
Merged
johnleider
merged 4 commits into
vuetifyjs:master
from
elkofy:fix/19543-autocomplete-update-search-event-triggered-on-leave
May 7, 2024
Merged
fix(VAutocomplete): only clear search on blur in multiple mode or using chips/selection shots #19701
johnleider
merged 4 commits into
vuetifyjs:master
from
elkofy:fix/19543-autocomplete-update-search-event-triggered-on-leave
May 7, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MajesticPotatoe
added
T: bug
Functionality that does not work as intended/expected
C: VAutocomplete
VAutocomplete
labels
Apr 30, 2024
yuwu9145
changed the title
fix(AutoComplete): don't alter search value when out of focus
fix(VAutocomplete): only clear search on blur in single mode
May 6, 2024
yuwu9145
changed the title
fix(VAutocomplete): only clear search on blur in single mode
fix(VAutocomplete): only clear search on blur in single mode or using chips/selection shots
May 6, 2024
yuwu9145
changed the title
fix(VAutocomplete): only clear search on blur in single mode or using chips/selection shots
fix(VAutocomplete): only clear search on blur in multiple mode or using chips/selection shots
May 6, 2024
<template>
<v-app>
<v-container class="mx-2">
<v-row>
<v-col>
<v-autocomplete
:items="list"
density="compact"
label="Multiple Chips"
title="Choose one"
variant="outlined"
item-title="n"
item-value="id"
hide-no-data
multiple
chips
@update:search="handleSeach"
></v-autocomplete>
<v-autocomplete
:items="list"
density="compact"
label="Multiple"
title="Choose one"
variant="outlined"
item-title="n"
item-value="id"
hide-no-data
multiple
@update:search="handleSeach"
></v-autocomplete>
<v-autocomplete
:items="list"
density="compact"
label="chips"
title="Choose one"
variant="outlined"
item-title="n"
item-value="id"
hide-no-data
chips
@update:search="handleSeach"
></v-autocomplete>
<v-autocomplete
:items="list"
density="compact"
label="Label"
title="Choose one"
variant="outlined"
item-title="n"
item-value="id"
hide-no-data
@update:search="handleSeach"
></v-autocomplete>
</v-col>
<v-col>
<v-btn @click="searchCount = 0">Clean Search Count</v-btn>
</v-col>
<v-col>Model: {{ model }} Search Count: {{ searchCount }}</v-col>
</v-row>
<v-row>
<v-col>
<ol>
<li>Choose one in list</li>
<li>Click outside autocomplete</li>
<li>Search occurs two times</li>
</ol>
</v-col>
</v-row>
</v-container>
</v-app>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const model = ref(0)
const searchCount = ref(0)
const list = ref([{n: 'Choose one', id: 0},{ n: 'test', id: 1 }, { n: 'test2', id: 2 }, { n: 'test3', id: 3 }])
function handleSeach(value: string) {
searchCount.value++
console.log(value)
}
</script>
|
yuwu9145
approved these changes
May 6, 2024
This was referenced May 31, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
resolves #19543
Markup: