Skip to main content



Fires when a task is copied into the clipboard


"copy-task": ({
id: string | number,
join?: boolean,
parent?: string | number | null,
project?: string | number | null,
targetId?: string | number,
reverse?: boolean
}) => void;


The callback of the copy-task event takes an object with the following parameters:

  • id - (required) the id of a task
  • join - (optional) defines the mode in which the task has been copied:
    • true - multiple copy mode
    • false - single copy mode

In case the copied task is also pasted from the clipboard into another position, the object can take four more parameters:

  • parent - (optional) the ID of the parent task
  • project - (optional) the ID of the project
  • targetId - (optional) the ID of the target task where the copied task is pasted
  • reverse - (optional) true, if the copied task is pasted before the target task; otherwise, false

To handle the inner events, you can use the Event Bus methods


const { ToDo, Toolbar } = todo;
const {tasks, projects, users} = getData();

const list = new ToDo("#root", {

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

// subscribe to the "copy-task" event
list.api.on("copy-task", ({id}) => {
console.log("The", id, "task is copied");

Change log: The join parameter was added in v1.1

Related article: Operations with tasks