Skip to content
Snippets Groups Projects
Commit bca11a6f authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

only filter when autocomplete is blur

parent 0d73bd09
No related branches found
No related tags found
2 merge requests!203Foldseek pages,!186Refactor facet autocomplete
Pipeline #119949 failed
This commit is part of merge request !186. Comments created here will be created in the context of that merge request.
...@@ -131,13 +131,14 @@ const isValidFilters = computed(() => { ...@@ -131,13 +131,14 @@ const isValidFilters = computed(() => {
const toValFilterStep = toValue(filterStep) const toValFilterStep = toValue(filterStep)
const toValFilterItems = toValue(filterItems) const toValFilterItems = toValue(filterItems)
if (toValFilterItems === undefined) { if (toValFilterItems === undefined || toValFilterItems?.length === 0) {
return true return true
} }
else { else {
const toValLastFilterItem = toValue(lastFilterItem) const toValLastFilterItem = toValue(lastFilterItem)
if (toValLastFilterItem !== undefined) { if (toValLastFilterItem !== undefined) {
return toValLastFilterItem.type === 'value' && isAutocompleteFocused.value === false || (toValFilterStep === 0 && toValLastFilterItem.type === "outerOperator" && toValLastFilterItem.value.split("-")[0] === "AND") return toValLastFilterItem.type === 'value' && isAutocompleteFocused.value === false
// || (toValFilterStep === 0 && toValLastFilterItem.type === "outerOperator" && toValLastFilterItem.value.split("-")[0] === "AND")
} }
} }
return false return false
...@@ -184,9 +185,6 @@ watchEffect(() => { ...@@ -184,9 +185,6 @@ watchEffect(() => {
console.log(meiliFilter) console.log(meiliFilter)
emit('update:modelValue', meiliFilter) emit('update:modelValue', meiliFilter)
} }
if (toValFilterStep === 0 && toValLastFilterItem !== undefined && toValLastFilterItem.type === "outerOperator" && toValLastFilterItem.value.split("-")[0] === "AND") {
}
}) })
</script> </script>
......
...@@ -374,6 +374,11 @@ function focusedOrBlur(isFocused: boolean) { ...@@ -374,6 +374,11 @@ function focusedOrBlur(isFocused: boolean) {
</template> </template>
</v-autocomplete> </v-autocomplete>
</v-toolbar> </v-toolbar>
<v-toolbar>
<AutocompleteMeiliFacets v-model="msFilterCompo" :db="props.db"
@refresh:search="() => console.log('refresh the search new compo')">
</AutocompleteMeiliFacets>
</v-toolbar>
</template> </template>
<template v-else> <template v-else>
<v-toolbar> <v-toolbar>
...@@ -391,7 +396,7 @@ function focusedOrBlur(isFocused: boolean) { ...@@ -391,7 +396,7 @@ function focusedOrBlur(isFocused: boolean) {
@update:focused="focusedOrBlur"></v-text-field> @update:focused="focusedOrBlur"></v-text-field>
</v-card> </v-card>
<v-card variant="flat" color="transparent" :min-width="500" class="mx-2" :rounded="false"> <v-card variant="flat" color="transparent" :min-width="500" class="mx-2" :rounded="false">
<v-autocomplete ref="autocompleteInput" hide-details v-model:model-value="filterOrSearch" <!-- <v-autocomplete ref="autocompleteInput" hide-details v-model:model-value="filterOrSearch"
auto-select-first chips clearable label="Filter results..." :items="autocompleteItems" auto-select-first chips clearable label="Filter results..." :items="autocompleteItems"
single-line item-value="value" item-title="title" multiple return-object single-line item-value="value" item-title="title" multiple return-object
:disabled="pendingDownloadData" prepend-inner-icon="md:search" :disabled="pendingDownloadData" prepend-inner-icon="md:search"
...@@ -408,7 +413,7 @@ function focusedOrBlur(isFocused: boolean) { ...@@ -408,7 +413,7 @@ function focusedOrBlur(isFocused: boolean) {
</v-list-item> </v-list-item>
</template> </template>
</v-autocomplete> </v-autocomplete> -->
</v-card> </v-card>
<v-card> <v-card>
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment