mirror of
https://github.com/supabase/supabase.git
synced 2026-10-12 12:55:06 +03:00
handle edge case when moving columns
This commit is contained in:
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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user