diff --git a/src/components/EditTableCellValueForm.vue b/src/components/EditTableCellValueForm.vue index 7d333ecb8..172866191 100644 --- a/src/components/EditTableCellValueForm.vue +++ b/src/components/EditTableCellValueForm.vue @@ -84,7 +84,6 @@ const closeForm = () => { :options="fieldsOptions" hide-selected option-label="label" - :option-caption="false" v-model="selectedField" data-cy="field-to-edit" /> diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index 58b7667d2..b78c99b8a 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -113,8 +113,15 @@ const $props = defineProps({ }); const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])]; -const { optionLabel, optionValue, optionFilter, optionFilterValue, options, modelValue } = - toRefs($props); +const { + optionLabel, + optionValue, + optionCaption, + optionFilter, + optionFilterValue, + options, + modelValue, +} = toRefs($props); const myOptions = ref([]); const myOptionsOriginal = ref([]); const vnSelectRef = ref(); @@ -321,6 +328,11 @@ function handleKeyDown(event) { } } } + +function getCaption(opt) { + if (optionCaption.value === false) return; + return opt[optionCaption.value] || opt[optionValue.value]; +}