Browse Source

fix: handle trailing spaces for select columns

pull/6583/head
mertmit 1 year ago
parent
commit
c88ed1acaa
  1. 4
      packages/nc-gui/components/cell/MultiSelect.vue
  2. 2
      packages/nc-gui/components/cell/SingleSelect.vue

4
packages/nc-gui/components/cell/MultiSelect.vue

@ -142,8 +142,8 @@ const selectedTitles = computed(() =>
} }
return 0 return 0
}) })
: modelValue.split(',') : modelValue.split(',').map((el) => el.trim())
: modelValue : modelValue.map((el) => el.trim())
: [], : [],
) )

2
packages/nc-gui/components/cell/SingleSelect.vue

@ -102,7 +102,7 @@ const hasEditRoles = computed(() => isUIAllowed('dataEdit'))
const editAllowed = computed(() => (hasEditRoles.value || isForm.value) && active.value) const editAllowed = computed(() => (hasEditRoles.value || isForm.value) && active.value)
const vModel = computed({ const vModel = computed({
get: () => tempSelectedOptState.value ?? modelValue, get: () => tempSelectedOptState.value ?? modelValue?.trim(),
set: (val) => { set: (val) => {
if (val && isNewOptionCreateEnabled.value && (options.value ?? []).every((op) => op.title !== val)) { if (val && isNewOptionCreateEnabled.value && (options.value ?? []).every((op) => op.title !== val)) {
tempSelectedOptState.value = val tempSelectedOptState.value = val

Loading…
Cancel
Save