handle edge case when moving columns

This commit is contained in:
Gildas Garcia committed 2026-03-19 10:31:17 +01:00
1 parent f355960ed8
commit 5007d8606d
1 file changed
+1 -1
@@ -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)
}