diff --git a/packages/nc-gui/components/cell/MultiSelect.vue b/packages/nc-gui/components/cell/MultiSelect.vue index 9559bcb48c..4f0c8346d0 100644 --- a/packages/nc-gui/components/cell/MultiSelect.vue +++ b/packages/nc-gui/components/cell/MultiSelect.vue @@ -100,7 +100,7 @@ const options = computed<(SelectOptionType & { value?: string })[]>(() => { const limitOptionsById = ((parseProp(column.value.meta)?.limitOptions || []).reduce( (o: Record, f: FormFieldsLimitOptionsType) => { - if (f?.order !== undefined && order < f.order) { + if (order < (f?.order ?? 0)) { order = f.order } return { @@ -118,18 +118,18 @@ const options = computed<(SelectOptionType & { value?: string })[]>(() => { (parseProp(column.value.meta)?.limitOptions || []).length ) { return opts - ?.filter((o: SelectOptionType) => { + .filter((o: SelectOptionType) => { if (limitOptionsById[o.id!]?.show !== undefined) { return limitOptionsById[o.id!]?.show } return false }) - ?.map((o) => ({ + .map((o) => ({ ...o, value: o.title, order: o.id && limitOptionsById[o.id] ? limitOptionsById[o.id]?.order : order++, })) - ?.sort((a, b) => a.order - b.order) + .sort((a, b) => a.order - b.order) } else { return opts.map((o: SelectOptionType) => ({ ...o, value: o.title })) } @@ -390,7 +390,7 @@ const onFocus = () => {