feat(filter): add unique id to filter input
This commit is contained in:
parent
b8ff7910b0
commit
6e53bf4ebe
@ -22,6 +22,7 @@ import {
|
|||||||
} from '@/helpers/filters'
|
} from '@/helpers/filters'
|
||||||
import {useDebounceFn} from '@vueuse/core'
|
import {useDebounceFn} from '@vueuse/core'
|
||||||
import {useI18n} from 'vue-i18n'
|
import {useI18n} from 'vue-i18n'
|
||||||
|
import {createRandomID} from '@/helpers/randomId'
|
||||||
|
|
||||||
const {t} = useI18n()
|
const {t} = useI18n()
|
||||||
|
|
||||||
@ -43,6 +44,8 @@ const {
|
|||||||
height,
|
height,
|
||||||
} = useAutoHeightTextarea(filterQuery)
|
} = useAutoHeightTextarea(filterQuery)
|
||||||
|
|
||||||
|
const id = ref(createRandomID())
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => modelValue,
|
() => modelValue,
|
||||||
() => {
|
() => {
|
||||||
@ -253,6 +256,7 @@ const blurDebounced = useDebounceFn(() => emit('blur'), 500)
|
|||||||
<div class="field">
|
<div class="field">
|
||||||
<label
|
<label
|
||||||
class="label"
|
class="label"
|
||||||
|
:for="id"
|
||||||
>
|
>
|
||||||
{{ inputLabel ?? $t('filters.query.title') }}
|
{{ inputLabel ?? $t('filters.query.title') }}
|
||||||
</label>
|
</label>
|
||||||
@ -268,8 +272,8 @@ const blurDebounced = useDebounceFn(() => emit('blur'), 500)
|
|||||||
<textarea
|
<textarea
|
||||||
ref="filterInput"
|
ref="filterInput"
|
||||||
v-model="filterQuery"
|
v-model="filterQuery"
|
||||||
|
:id
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
|
|
||||||
autocorrect="off"
|
autocorrect="off"
|
||||||
autocapitalize="off"
|
autocapitalize="off"
|
||||||
spellcheck="false"
|
spellcheck="false"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user