Add drag-and-drop data transfer support in EnhancedKanbanBoardNativeDnD
This commit is contained in:
@@ -82,6 +82,9 @@ const EnhancedKanbanBoardNativeDnD: React.FC<{ projectId: string }> = ({ project
|
|||||||
setDraggedGroupId(groupId);
|
setDraggedGroupId(groupId);
|
||||||
setDragType('group');
|
setDragType('group');
|
||||||
e.dataTransfer.effectAllowed = 'move';
|
e.dataTransfer.effectAllowed = 'move';
|
||||||
|
try {
|
||||||
|
e.dataTransfer.setData('text/plain', groupId);
|
||||||
|
} catch {}
|
||||||
};
|
};
|
||||||
const handleGroupDragOver = (e: React.DragEvent) => {
|
const handleGroupDragOver = (e: React.DragEvent) => {
|
||||||
if (dragType !== 'group') return;
|
if (dragType !== 'group') return;
|
||||||
@@ -182,6 +185,9 @@ const EnhancedKanbanBoardNativeDnD: React.FC<{ projectId: string }> = ({ project
|
|||||||
setDraggedTaskGroupId(groupId);
|
setDraggedTaskGroupId(groupId);
|
||||||
setDragType('task');
|
setDragType('task');
|
||||||
e.dataTransfer.effectAllowed = 'move';
|
e.dataTransfer.effectAllowed = 'move';
|
||||||
|
try {
|
||||||
|
e.dataTransfer.setData('text/plain', taskId);
|
||||||
|
} catch {}
|
||||||
};
|
};
|
||||||
const handleTaskDragOver = (e: React.DragEvent, groupId: string, taskIdx: number | null) => {
|
const handleTaskDragOver = (e: React.DragEvent, groupId: string, taskIdx: number | null) => {
|
||||||
if (dragType !== 'task') return;
|
if (dragType !== 'task') return;
|
||||||
|
|||||||
Reference in New Issue
Block a user