Skip to content

Drag, Resize, And Progress Editing

Source code
---
import '@revolist/gantt/styles.css';
import GanttScheduling from '@revolist/revogrid-examples/components/gantt/GanttScheduling.vue';
---
<GanttScheduling client:only="vue" />

Implemented interactions:

  • Drag task bars to move.
  • Drag start/end handles to resize.
  • Drag progress handle to update completion.

During a move or resize, a live readout shows the proposed start, finish, duration, and snapping unit. Datetime tasks include times by default. The proposed values use the same snapping policy as the released edit; the moving bar follows the pointer. Hold the pointer near either timeline edge to scroll while editing.

Press Escape before releasing to cancel the gesture. The task and history remain unchanged, and releasing afterward does not commit the canceled edit.

At compressed scales, the readout recommends zooming in for finer control. Use the toolbar zoom controls before making precise edits: equal pixel movements represent different date ranges at different zoom levels.

Each interaction has preview state and commit state and can trigger warning/diagnostic updates.

Gantt supports phones, tablets, and hybrid devices through adaptive pointer handling. Desktop users can drag task bars and handles directly. Touch users get a safer select-then-edit flow so scrolling a dense timeline does not accidentally change the schedule.

On coarse-pointer devices:

  • Tap a task bar to select it.
  • Selection reveals larger resize, dependency, progress, and split handles.
  • Drag the selected task bar to move the task.
  • Drag a visible start/end handle to resize.
  • Drag the visible progress handle to update completion.
  • Start swiping from an unselected task bar when you want to pan the task table or timeline; hidden handles are not hit-testable until selection.

The mobile path keeps native panning available for unselected task bars and disables browser touch panning only on selected/active bars or visible edit handles. This preserves scroll-first behavior while still allowing precise edits after the user has selected the task.

The packaged task editor dialog also adapts to phone-width screens with a full-viewport, single-column layout and larger touch targets.

Implementation:

  • features/tasks/controllers/task-drag-controller.ts
  • features/tasks/controllers/task-resize-controller.ts
  • features/tasks/controllers/task-progress-controller.ts
  • features/tasks/controllers/pointer-gesture.ts
  • features/tasks/timeline-preview-layer.ts