From 5007d8606dd480d9ed4163a6761bac1ffdb166cb Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Thu, 19 Mar 2026 10:31:17 +0100 Subject: [PATCH] handle edge case when moving columns --- .../components/interfaces/Database/Schemas/SchemaTableNode.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/studio/components/interfaces/Database/Schemas/SchemaTableNode.tsx b/apps/studio/components/interfaces/Database/Schemas/SchemaTableNode.tsx index 68158f7ecda..0fcfd30767a 100644 --- a/apps/studio/components/interfaces/Database/Schemas/SchemaTableNode.tsx +++ b/apps/studio/components/interfaces/Database/Schemas/SchemaTableNode.tsx @@ -83,7 +83,7 @@ export const TableNode = memo(function TableNode({ if (over) { const overIndex = columns.findIndex((column) => column.id === over.id) const activeIndex = columns.findIndex((column) => column.id === active.id) - if (activeIndex !== overIndex) { + if (activeIndex >= 0 && overIndex >= 0 && activeIndex !== overIndex) { const newColumns = arrayMove(columns, activeIndex, overIndex) persistColumns(newColumns) }