mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-03 18:16:59 +00:00
fix(nc-gui): avoid keeping unnecessary props when switching column type
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user