diff --git a/packages/nc-gui/composables/useColumnCreateStore.ts b/packages/nc-gui/composables/useColumnCreateStore.ts index 9816b4e183..922b12464c 100644 --- a/packages/nc-gui/composables/useColumnCreateStore.ts +++ b/packages/nc-gui/composables/useColumnCreateStore.ts @@ -97,7 +97,19 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState const onUidtOrIdTypeChange = () => { const colProp = sqlUi.value.getDataTypeForUiType(formState.value as { uidt: UITypes }, idType ?? undefined) formState.value = { - ...formState.value, + ...(!isEdit.value && { + // only take title, column_name and uidt when creating a column + // to avoid the extra props from being taken (e.g. SingleLineText -> LTAR -> SingleLineText) + // to mess up the column creation + title: formState.value.title, + column_name: formState.value.column_name, + uidt: formState.value.uidt, + }), + ...(isEdit.value && { + // take the existing formState.value when editing a column + // LTAR is not available in this case + ...formState.value, + }), meta: {}, rqd: false, pk: false,