fix(filter): bubble filter query changes up on blur only
This commit is contained in:
parent
1d2f3ca546
commit
533e778b93
@ -29,7 +29,7 @@ const {
|
|||||||
projectId?: number,
|
projectId?: number,
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue'])
|
const emit = defineEmits(['update:modelValue', 'blur'])
|
||||||
|
|
||||||
const filterQuery = ref<string>('')
|
const filterQuery = ref<string>('')
|
||||||
const {
|
const {
|
||||||
@ -257,6 +257,8 @@ function autocompleteSelect(value) {
|
|||||||
class="input"
|
class="input"
|
||||||
:class="{'has-autocomplete-results': autocompleteResults.length > 0}"
|
:class="{'has-autocomplete-results': autocompleteResults.length > 0}"
|
||||||
ref="filterInput"
|
ref="filterInput"
|
||||||
|
:placeholder="$t('filters.query.placeholder')"
|
||||||
|
@blur="e => emit('blur', e)"
|
||||||
></textarea>
|
></textarea>
|
||||||
<div
|
<div
|
||||||
class="filter-input-highlight"
|
class="filter-input-highlight"
|
||||||
@ -344,10 +346,15 @@ function autocompleteSelect(value) {
|
|||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
text-fill-color: transparent;
|
|
||||||
-webkit-text-fill-color: transparent;
|
|
||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
resize: none;
|
resize: none;
|
||||||
|
text-fill-color: transparent;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
|
||||||
|
&::placeholder {
|
||||||
|
text-fill-color: var(--input-placeholder-color);
|
||||||
|
-webkit-text-fill-color: var(--input-placeholder-color);
|
||||||
|
}
|
||||||
|
|
||||||
&.has-autocomplete-results {
|
&.has-autocomplete-results {
|
||||||
border-radius: var(--input-radius) var(--input-radius) 0 0;
|
border-radius: var(--input-radius) var(--input-radius) 0 0;
|
||||||
|
@ -4,20 +4,21 @@
|
|||||||
:title="hasTitle ? $t('filters.title') : ''"
|
:title="hasTitle ? $t('filters.title') : ''"
|
||||||
role="search"
|
role="search"
|
||||||
>
|
>
|
||||||
|
<FilterInput
|
||||||
|
v-model="params.filter"
|
||||||
|
:project-id="projectId"
|
||||||
|
@blur="change()"
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="field is-flex is-flex-direction-column">
|
<div class="field is-flex is-flex-direction-column">
|
||||||
<Fancycheckbox
|
<Fancycheckbox
|
||||||
v-model="params.filter_include_nulls"
|
v-model="params.filter_include_nulls"
|
||||||
@update:modelValue="change()"
|
@blur="change()"
|
||||||
>
|
>
|
||||||
{{ $t('filters.attributes.includeNulls') }}
|
{{ $t('filters.attributes.includeNulls') }}
|
||||||
</Fancycheckbox>
|
</Fancycheckbox>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<FilterInput
|
|
||||||
v-model="params.filter"
|
|
||||||
:project-id="projectId"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<x-button
|
<x-button
|
||||||
variant="primary"
|
variant="primary"
|
||||||
@ -37,7 +38,6 @@ export const ALPHABETICAL_SORT = 'title'
|
|||||||
import {computed, ref} from 'vue'
|
import {computed, ref} from 'vue'
|
||||||
import {watchDebounced} from '@vueuse/core'
|
import {watchDebounced} from '@vueuse/core'
|
||||||
import Fancycheckbox from '@/components/input/fancycheckbox.vue'
|
import Fancycheckbox from '@/components/input/fancycheckbox.vue'
|
||||||
import {objectToSnakeCase} from '@/helpers/case'
|
|
||||||
import FilterInput from '@/components/project/partials/FilterInput.vue'
|
import FilterInput from '@/components/project/partials/FilterInput.vue'
|
||||||
import {useRoute} from 'vue-router'
|
import {useRoute} from 'vue-router'
|
||||||
import type {TaskFilterParams} from '@/services/taskCollection'
|
import type {TaskFilterParams} from '@/services/taskCollection'
|
||||||
@ -75,7 +75,7 @@ const params = ref<TaskFilterParams>({
|
|||||||
watchDebounced(
|
watchDebounced(
|
||||||
() => modelValue.value,
|
() => modelValue.value,
|
||||||
(value: TaskFilterParams) => {
|
(value: TaskFilterParams) => {
|
||||||
const val = value
|
const val = {...value}
|
||||||
val.filter = transformFilterStringFromApi(
|
val.filter = transformFilterStringFromApi(
|
||||||
val?.filter || '',
|
val?.filter || '',
|
||||||
labelId => labelStore.getLabelById(labelId),
|
labelId => labelStore.getLabelById(labelId),
|
||||||
|
@ -418,7 +418,8 @@
|
|||||||
"success": "The filter was saved successfully."
|
"success": "The filter was saved successfully."
|
||||||
},
|
},
|
||||||
"query": {
|
"query": {
|
||||||
"title": "Query"
|
"title": "Query",
|
||||||
|
"placeholder": "Type a search or filter query…"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"migrate": {
|
"migrate": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user