chore(react/collections/board): fix column dragging offset

This commit is contained in:
Elian Doran
2025-09-13 11:01:39 +03:00
parent e77a49ace6
commit 4f469d0d3c
3 changed files with 60 additions and 31 deletions

View File

@@ -106,7 +106,15 @@ export default class BoardApi {
const newColumns = [...this.columns];
const [movedColumn] = newColumns.splice(fromIndex, 1);
newColumns.splice(toIndex, 0, movedColumn);
// Adjust toIndex after removing the element
// When moving forward (right), the removal shifts indices left
let adjustedToIndex = toIndex;
if (fromIndex < toIndex) {
adjustedToIndex = toIndex - 1;
}
newColumns.splice(adjustedToIndex, 0, movedColumn);
// Update view config with new column order
const newViewConfig = {