diff --git a/packages/nc-gui/components/smartsheet/details/Fields.vue b/packages/nc-gui/components/smartsheet/details/Fields.vue index 972e5a472b..768786ab31 100644 --- a/packages/nc-gui/components/smartsheet/details/Fields.vue +++ b/packages/nc-gui/components/smartsheet/details/Fields.vue @@ -343,12 +343,21 @@ const onFieldAdd = (state: TableExplorerColumn) => { } const onMove = (_event: { moved: { newIndex: number; oldIndex: number } }) => { - const order = calculateOrderForIndex(_event.moved.newIndex, _event.moved.newIndex < _event.moved.oldIndex) - const field = fields.value[_event.moved.oldIndex] + const order = calculateOrderForIndex(_event.moved.newIndex, _event.moved.newIndex < _event.moved.oldIndex) const op = ops.value.find((op) => compareCols(op.column, field)) + if (op?.op === 'update') { + message.warning('You cannot move field that is being edited. Either save or discard changes first') + return + } + + if (op?.op === 'delete') { + message.warning('You cannot move field that is deleted. Either save or discard changes first') + return + } + if (op) { onFieldUpdate({ ...op.column, @@ -556,276 +565,250 @@ onMounted(async () => {