diff --git a/packages/nc-gui/components/cell/MultiSelect.vue b/packages/nc-gui/components/cell/MultiSelect.vue index ab227f90f0..6c00425d9f 100644 --- a/packages/nc-gui/components/cell/MultiSelect.vue +++ b/packages/nc-gui/components/cell/MultiSelect.vue @@ -316,10 +316,10 @@ const handleClose = (e: MouseEvent) => { useEventListener(document, 'click', handleClose, true) const selectedOpts = computed(() => { - return options.value.reduce<(SelectOptionType & { index: number })[]>((selectedOptions, option) => { - const index = vModel.value.indexOf(option.value!) - if (index !== -1) { - selectedOptions.push({ ...option, index }) + return vModel.value.reduce((selectedOptions, option) => { + const selectedOption = options.value.find((o) => o.value === option) + if (selectedOption) { + selectedOptions.push(selectedOption) } return selectedOptions }, []) @@ -340,7 +340,7 @@ const selectedOpts = computed(() => { }" >