diff --git a/packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue b/packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue index 7ddc1630a6..8367bc7c84 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue @@ -69,6 +69,7 @@ const options = computed(() => ?.sort((field1, field2) => { let orderVal1 = 0 let orderVal2 = 0 + let sortByOrder = 0 if (isSystemColumn(field1)) { orderVal1 = 1 @@ -77,7 +78,11 @@ const options = computed(() => orderVal2 = 1 } - return orderVal1 - orderVal2 + if (field1?.order !== undefined && field2?.order !== undefined) { + sortByOrder = field1.order - field2.order + } + + return orderVal1 - orderVal2 || sortByOrder }) ?.map((c: ColumnType) => ({ value: c.id, diff --git a/packages/nc-gui/components/smartsheet/toolbar/FieldListWithSearch.vue b/packages/nc-gui/components/smartsheet/toolbar/FieldListWithSearch.vue index ee62cd4f84..44e4f92f7f 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/FieldListWithSearch.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/FieldListWithSearch.vue @@ -1,5 +1,5 @@