fix(VnSelect): refs #8224 improve focus handling and update selected item template
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
4ad9a3e613
commit
f509616f86
|
@ -397,13 +397,15 @@ function getOptionLabel(property) {
|
|||
@keydown="handleKeyDown"
|
||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"
|
||||
:data-url="url"
|
||||
@focus="
|
||||
@blur="hasFocus = false"
|
||||
@update:model-value="() => vnSelectRef.blur()"
|
||||
@popup-show="
|
||||
async () => {
|
||||
hasFocus = true;
|
||||
await $nextTick();
|
||||
vnSelectRef?.$el?.querySelector('input')?.focus();
|
||||
}
|
||||
"
|
||||
@blur="() => (hasFocus = false)"
|
||||
@update:model-value="vnSelectRef.blur()"
|
||||
>
|
||||
<template #append>
|
||||
<QIcon
|
||||
|
@ -412,7 +414,6 @@ function getOptionLabel(property) {
|
|||
@click="
|
||||
() => {
|
||||
value = null;
|
||||
vnSelectRef.blur();
|
||||
emit('remove');
|
||||
}
|
||||
"
|
||||
|
@ -454,9 +455,15 @@ function getOptionLabel(property) {
|
|||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
<template #selected-item="scope" v-if="valueIsObject">
|
||||
<span class="nowrap" @click="vnSelectRef.showPopup()">
|
||||
<s class="nowrap" v-if="scope?.opt.neq" v-text="getOptionLabel('neq')" />
|
||||
<template #selected v-if="valueIsObject">
|
||||
<span class="nowrap">
|
||||
<s
|
||||
class="nowrap"
|
||||
v-if="modelValue?.neq"
|
||||
v-text="getOptionLabel('neq')"
|
||||
:title="getOptionLabel('neq')"
|
||||
/>
|
||||
<span v-else>{{ JSON.stringify(modelValue) }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</QSelect>
|
||||
|
|
Loading…
Reference in New Issue