Browse Source

fix: check value is defined or not

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5665/head
Pranav C 2 years ago
parent
commit
8d2b551bf4
  1. 2
      packages/nc-gui/components/cell/SingleSelect.vue

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

@ -97,7 +97,7 @@ const editAllowed = computed(() => (hasEditRoles.value || isForm.value) && (acti
const vModel = computed({ const vModel = computed({
get: () => tempSelectedOptState.value ?? modelValue, get: () => tempSelectedOptState.value ?? modelValue,
set: (val) => { set: (val) => {
if (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
return addIfMissingAndSave() return addIfMissingAndSave()
} }

Loading…
Cancel
Save