Skip to main content

drag

Description

Optional. Specifies settings for drag-n-drop

note

There is 500ms delay when you drag-n-drop tasks on touch devices.

Usage

drag?: boolean;
//or
drag?: {
expand?: boolean
};

Parameters

To configure drag-n-drop, you can use either the short or extended option.

The short option:

  • drag - (optional) enables/disables drag-n-drop of tasks

The extended option:

  • drag - (optional) an object with settings for drag-n-drop. The object can include the following parameter:
    • expand - (optional) defines whether the collapsed tasks should expand when you hover them over during drag-n-drop

Default config

drag: true
// or
drag: {
expand: true
}

Example

const { ToDo, Toolbar } = todo;

// create To do list
const list = new ToDo("#root", {
tasks: [
{ id: "1", text: "Task 1 #tag1" },
...
],
drag: {
expand: false
}
});

const toolbar = new Toolbar("#toolbar", {
api: list.api,
});

Change log: Added in v1.1

Related article: Configuration