gantt-lib 0.105.0 → 0.105.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -10996,10 +10996,12 @@ function TaskGanttChartInner(props, ref) {
10996
10996
  onTasksChange?.([promotedTask]);
10997
10997
  return;
10998
10998
  }
10999
+ const tasksWithoutPromoted = tasks.filter((t) => t.id !== taskId);
11000
+ const insertIndex = lastSiblingIndex.index;
10999
11001
  const reorderedTasks = normalizeHierarchyTasks([
11000
- ...tasks.filter((t) => t.id !== taskId).slice(0, lastSiblingIndex.index + 1),
11002
+ ...tasksWithoutPromoted.slice(0, insertIndex),
11001
11003
  promotedTask,
11002
- ...tasks.filter((t) => t.id !== taskId).slice(lastSiblingIndex.index + 1)
11004
+ ...tasksWithoutPromoted.slice(insertIndex)
11003
11005
  ]);
11004
11006
  onTasksChange?.(reorderedTasks);
11005
11007
  }, [tasks, onTasksChange, onPromoteTask]);