Skip to content

Commit

Permalink
fix(InputMenu/SelectMenu): prevent double filter with async search
Browse files Browse the repository at this point in the history
Resolves #1966
  • Loading branch information
benjamincanac committed Jul 16, 2024
1 parent 46e9b12 commit e2881d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/runtime/components/forms/InputMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ export default defineComponent({
const debouncedSearch = props.search && typeof props.search === 'function' ? useDebounceFn(props.search, props.debounce) : undefined
const options = computedAsync(async () => {
if (props.search && debouncedSearch) {
if (debouncedSearch) {
return await debouncedSearch(query.value)
}
Expand All @@ -401,7 +401,7 @@ export default defineComponent({
})
const filteredOptions = computed(() => {
if (!query.value) {
if (!query.value || debouncedSearch) {
return options.value
}
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/forms/SelectMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ export default defineComponent({
const debouncedSearch = props.searchable && typeof props.searchable === 'function' ? useDebounceFn(props.searchable, props.debounce) : undefined
const options = computedAsync(async () => {
if (props.searchable && debouncedSearch) {
if (debouncedSearch) {
return await debouncedSearch(query.value)
}
Expand All @@ -464,7 +464,7 @@ export default defineComponent({
})
const filteredOptions = computed(() => {
if (!query.value) {
if (!query.value || debouncedSearch) {
return options.value
}
Expand Down

0 comments on commit e2881d3

Please sign in to comment.