Our flexible Kanban board for managing tasks with drag drop


Post by harish22 »

Hi,

I am using the Taskboard Angular library, specifically version 6.2.2, and I have a function that calculates the index of a task when it is dropped. The following code worked fine in v6.2.2:

onTaskDrop({ taskRecords, targetColumn, source, assignTask }: any): void {
    const taskIndex = targetColumn.tasks.findIndex(task => task.id === taskRecords.id);
}

However, after upgrading to v6.3.1, the same code no longer gives the correct index. The findIndex function still returns an index, but it’s incorrect.

Details:

In v6.2.2, targetColumn.index worked as expected, and I could calculate the correct index for the task.

After upgrading to v6.3.1, the index returned by findIndex does not match the correct position of the task in targetColumn.tasks.

Are there any changes in the new version that could affect how targetColumn.index is handled? Or is there a new approach to correctly calculating the task index after the upgrade?

  1. Screen flickering on updates:

In addition, screen flickering occurs when the taskboard updates (for example, when tasks are moved or dropped). This issue wasn’t present in v6.2.2.

I would appreciate any insights or solutions.

Thanks!


Post by marcio »

Hey harish22,

Thanks for reaching out.

If you see the payload description of the taskDrop event here, you'll see it's an array, so taskRecords.id looks like it would be undefined now. Try to add a check like this and see if you have a different result

const dropped = Array.isArray(taskRecords) ? taskRecords[0] : taskRecords;

Or use the project store directly:

const taskIndex = taskBoard.project.taskStore.indexOf(dropped);

Regarding the flickering, we would need a runnable test case and a recording to help identify/reproduce the behavior.

Best regards,
Márcio

How to ask for help? Please read our Support Policy


Post Reply