> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nextedy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure Drag Children Behavior

> This guide shows you how to control whether child tasks move together with their parent when you drag a parent task bar in Nextedy GANTT.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

## Prerequisites

* A Gantt widget with parent-child task hierarchy configured via the **Parent Role** parameter
* Edit mode access

## Understand the `dragChildren` Widget Parameter

The `dragChildren` widget parameter controls whether dragging a parent task automatically moves all its child tasks by the same offset. When enabled, the entire subtree shifts together, preserving the relative schedule. When disabled, only the parent moves and children stay at their original dates.

| Parameter      | Type    | Default | Description                                   |
| -------------- | ------- | ------- | --------------------------------------------- |
| `dragChildren` | Boolean | `true`  | Move child tasks together with parent on drag |

## Enable or Disable Drag Children

1. Open the Polarion page containing the Gantt widget
2. Edit the widget properties
3. Set the **Drag Children** parameter:
   * **Yes** (default) -- children move with parent
   * **No** -- only the parent task moves; children remain at their original dates

## Toggle Drag Children at Runtime

You can also toggle this behavior during an active edit session using the toolbar:

1. Enter Edit mode by clicking  **Edit** in the toolbar
2. Locate the **Drag Children** toggle button in the toolbar
3. Click it to switch between moving children together or leaving them independent

This is useful when you need to move a parent to a new time slot without disrupting individually scheduled children.

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/DDjWgCW2DWY5biNv/gantt/diagrams/guides/editing/drag-children/diagram-1.svg?fit=max&auto=format&n=DDjWgCW2DWY5biNv&q=85&s=60ad8b0269a897c48654116da4b0cd9a" alt="diagram" style={{ maxWidth: "560px", width: "100%" }} width="560" height="460" data-path="gantt/diagrams/guides/editing/drag-children/diagram-1.svg" />
</Frame>

## Range Conflict Detection

When you drag tasks independently (with `dragChildren` disabled), child tasks may end up outside their parent's date range. The Gantt can detect and highlight these conflicts:

* Conflicting tasks receive a visual warning style (highlighted border)
* Both the parent and the out-of-range child are marked
* Conflict highlighting clears automatically when the task is moved back within the parent's range
* Range conflict checks respect the working calendar when evaluating boundaries

<Note title="Range conflict is disabled by default">
  Range conflict detection requires explicit enablement. The default configuration has `rangeConflict.enabled = false`. When enabled, you can further control detection with `rangeConflict.checkStart` and `rangeConflict.checkEnd` to check start date, end date, or both.
</Note>

## Automatic Conflict Resolution

When a child task is dragged outside its parent's date range, the Gantt can automatically resolve the conflict by expanding the parent's range to accommodate the child's new position. This resolution works hierarchically -- all ancestor tasks in the tree are adjusted, not just the immediate parent. The same resolution applies when a task is resized beyond its parent's boundaries.

<Tip title="Lock specific items from dragging">
  To prevent certain work items from being moved at all, use an **Item Script** to set `task.readonly = true` for specific work item types. For example, to lock user stories while allowing tasks to be dragged:

  ```javascript theme={null}
  if (wi.getType().getId() === 'userstory') {
      task.readonly = true;
  }
  ```

  This approach lets you protect parent items from accidental rescheduling while keeping children editable.
</Tip>

<Warning title="Drag-and-drop between parents not supported">
  The Gantt does not support drag-and-drop to move a task from one parent to another. To change a task's parent, edit the parent link directly through the work item form in Polarion or use the lightbox.
</Warning>

## Verify Your Configuration

1. Enter Edit mode in the Gantt
2. Drag a parent task bar to a new date
3. If `dragChildren` is enabled, you should now see all child task bars shift by the same number of days
4. If `dragChildren` is disabled, only the parent bar moves and children remain in place
5. Toggle the **Drag Children** toolbar button and repeat the test to confirm the toggle works

## See Also

* [Prevent Tasks from Moving Outside Parent Range](/gantt/guides/scheduling/prevent-moving-out-of-parent) for parent-bound scheduling constraints
* [Derive Parent Schedule from Children](/gantt/guides/scheduling/parent-derived-schedule) for the inverse pattern
* [Configure Auto-Scheduling](/gantt/guides/scheduling/configure-auto-scheduling) for dependency-driven date propagation
* [Perform What-If Analysis Without Saving](/gantt/guides/scheduling/what-if-analysis) for exploring schedule changes safely

<LastReviewed date="2026-07-02" />
