Skip to content

Operate a Gantt Chart from the Keyboard: Move, Resize, and Undo Task Changes ​

Dark Gantt chart with task dependencies, progress bars, and a violet-highlighted development task.

Dragging a Gantt bar is one way to express a schedule change. It should not be the only way. A keyboard user needs to select the same task, move its dates, change its duration, understand the scheduling result and undo an accepted change without reaching for a mouse.

A keyboard-accessible Gantt chart needs more than focusable task bars. Keyboard commands should enter the same scheduling, validation and history pipeline as pointer gestures. Otherwise a move made with an arrow key may ignore a dependency or calendar rule that a drag would have enforced.

This article uses the RevoGrid Gantt keyboard interaction available in the v4.4.3 release.

Translate gestures into scheduling commands ​

A timeline drag starts with a pixel coordinate, but the result is a scheduling operation. The same operation should be expressible as a task identity, a proposed date or duration, and a reason for the change.

User intentionCommand
Move taskShift the task to a proposed date; preserve duration
Resize right edgeChange proposed finish/duration
Resize left edgeChange proposed start/duration
UndoRestore the previous accepted schedule
RedoReapply the accepted schedule

For every command, resolve the task by ID, apply its calendar and constraints, recompute affected tasks, validate the resulting schedule, publish it and record the accepted operation. Do not implement keyboard movement by directly incrementing a CSS position or replacing a row's startDate without involving the engine.

When dependencies are active, the resulting transaction can affect several tasks. History should restore that transaction's schedule changes, not merely the bar that was focused.

Keyboard commands in RevoGrid Gantt ​

Tab into the timeline and focus an editable task bar. The following bindings are scoped to that bar, not to an arbitrary input or the whole document.

KeysAction
Up / DownFocus the preceding or following available task bar in current row order
Left / RightMove the focused task
Shift + Left / RightAdjust its finish
Alt + Shift + Left / RightAdjust its start
Enter / SpaceRequest the task editor when enabled
Undo / Redo controlsReverse or reapply an accepted change

Summary tasks and milestones do not support endpoint resizing. Locked tasks and read-only projects cannot be mutated. Keyboard commands use the same scheduling, validation, cancellation and history paths as timeline interactions.

The step uses the configured snap unit or the timeline precision: minute/hour precision for those scales and calendar days otherwise. At week, month, quarter and year scales a day step is seven calendar days. Working-time snapping may adjust the effective date; constraints can reject it. Test the actual schedule rather than assuming an arrow always adds exactly one day.

React example: a project with a dependency ​

Install the React grid wrapper, RevoGrid Pro and Gantt package. The Gantt plugin in the released source ensures that Event Manager and History are installed, so a separate history stack is not needed. Use the framework controls provider to put explicit history buttons above the chart.

tsx
import { useMemo } from 'react';
import { RevoGrid } from '@revolist/react-datagrid';
import {
  GanttPlugin,
  createDefaultTaskTableColumn,
  type DependencyEntity,
  type GanttPluginConfig,
  type GanttTaskSourceRow,
} from '@revolist/gantt';
import {
  GridControlsProvider,
  HistoryControls,
} from '@revolist/revogrid-pro/react';
import '@revolist/revogrid-pro/styles.css';
import '@revolist/gantt/styles.css';

type Calendar = NonNullable<GanttPluginConfig['calendars']>[number];
const plugins = [GanttPlugin];

export function KeyboardGantt() {
  const project = useMemo<GanttPluginConfig>(() => ({
    id: 'release-plan',
    name: 'Release plan',
    version: '1',
    currency: 'USD',
    timeZone: 'UTC',
    primaryCalendarId: 'standard',
    updatedAt: '2026-07-14T00:00:00.000Z',
    zoomPreset: 'day-week',
  }), []);
  const calendars = useMemo<Calendar[]>(() => [{
    id: 'standard',
    name: 'Standard',
    timeZone: 'UTC',
    workingDays: [1, 2, 3, 4, 5],
    holidays: [],
    hoursPerDay: 8,
  }], []);
  const tasks = useMemo<GanttTaskSourceRow[]>(() => [
    { id: 'design', name: 'Design', startDate: '2026-07-14',
      duration: 3, percentDone: 50, calendarId: 'standard' },
    { id: 'build', name: 'Build', startDate: '2026-07-17',
      duration: 5, percentDone: 0, calendarId: 'standard' },
  ], []);
  const dependencies = useMemo<DependencyEntity[]>(() => [{
    id: 'design-build',
    predecessorTaskId: 'design',
    successorTaskId: 'build',
    type: 'FS',
    lagDays: 0,
  }], []);
  const columns = useMemo(() => [
    createDefaultTaskTableColumn('name'),
    createDefaultTaskTableColumn('startDate'),
    createDefaultTaskTableColumn('duration'),
    createDefaultTaskTableColumn('percentDone'),
    createDefaultTaskTableColumn('predecessors'),
  ], []);

  return (
    <GridControlsProvider>
      <p>Focus a task bar. Arrow keys move it; Shift plus an arrow
        adjusts finish; Alt plus Shift plus an arrow adjusts start.</p>
      <HistoryControls />
      <RevoGrid style={{ height: 480 }} plugins={plugins}
        gantt={project} ganttCalendars={calendars}
        ganttDependencies={dependencies} source={tasks}
        columns={columns} />
    </GridControlsProvider>
  );
}

The local project collections stay stable across normal React renders. Replacing the project or task source unnecessarily can reset interaction state and history. For a server-owned project, integrate the application state and commands contracts rather than assuming a local history replay persists remote changes.

Check the schedule after every key ​

Use the Gantt accessibility live example or start with the React Gantt demo.

For the two-task fixture above, take a snapshot of both task dates and durations before each action. First move Design right on a weekday and check whether Build must be rescheduled according to the project's dependency rules. Then resize Design's finish. The expected invariant is that the accepted result is a valid schedule for the configured calendar, not just a changed bar width.

TestWhat to assert
Move task with Left / RightTask ID is unchanged; accepted dates reflect snap and calendar; duration is preserved
Resize finishStart is unchanged unless scheduling rules require another result; accepted duration/finish is consistent
Resize startFinish/duration reflect the accepted edit; no invalid interval is committed
Move across weekendCalendar and configured snapping are respected
Dependency cascadeRelated tasks match the scheduler result
Undo, then RedoEvery affected date and duration matches the corresponding captured state
Locked or read-only taskNo mutation and no new accepted history operation
Up / Down across virtual rowsFocus follows the displayed task identity and scrolls when necessary
Sort, collapse or remove a focused taskFocus stays on a valid element or recovers to an available task/grid
Open and close task editorFocus returns to the bar when it is still rendered

Repeat at multiple zoom levels. Test keyboard repeat as well as a single press, invalid constraints, milestones and summary tasks. Inspect the accessible name, status announcements and date fields; a screenshot alone cannot verify the result.

Focus and status announcements are part of the editing contract ​

A virtualized timeline cannot keep every task bar in the DOM. RevoGrid exposes a task-bar Tab entry in the rendered viewport, with Up and Down navigation between available tasks. It has focus recovery for several row removal, collapse and source replacement cases. Other combinations of filtering, collapsing and remote updates can still need application-level handling.

The task bar exposes schedule and keyboard instructions through an accessible description. Successful Undo and Redo and interaction changes use a status region. Applications can localize the messages through labels.interaction, including keyboardTaskHelp, keyboardTaskMoveHelp, keyboardTaskChanged, historyUndo and historyRedo.

Keep the focus ring visible and the task editor or an equivalent non-dragging pointer alternative available. Do not treat keyboard access as a complete accessibility compliance claim. Test supported screen readers, browser/OS combinations, zoom and forced colors. Remote save outcomes need their own announcements. Progress changes and dependency creation may require alternative table or form controls.

Compare keyboard support at the command level ​

Bryntum Gantt's keyboard documentation lists Gantt-specific indent and outdent commands and inherited Grid keyboard actions. Syncfusion Gantt accessibility documentation describes row/cell navigation, task editing dialogs and undo/redo shortcuts. Both provide meaningful keyboard workflows.

For an evaluation, distinguish navigating a Gantt chart or opening an editor from moving and resizing a focused bar directly. Test whether keyboard and pointer changes use the same scheduling and undo semantics in the versions you are evaluating. The RevoGrid workflow documented here includes those direct timeline commands; this does not establish that competing products cannot be configured to do the same.

For more on the scheduling model, see JavaScript Gantt chart dependencies and Gantt scheduling engine documentation. Explore the Gantt demo and Pro trial with your own calendar and constraints.

Compare scheduling and interaction features with Bryntum Gantt and Syncfusion Gantt.