Remove drag and drop entirely
This commit is contained in:
@@ -5,8 +5,6 @@ export interface TodoItemCallbacks {
|
||||
onToggle: (todo: TodoItem) => void;
|
||||
onMoveClick: (todo: TodoItem) => void;
|
||||
onClick: (todo: TodoItem) => void;
|
||||
onDragStart: (evt: DragEvent, todo: TodoItem) => void;
|
||||
onDragEnd: (evt: DragEvent) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,7 +29,6 @@ export function createTodoItemEl(
|
||||
callbacks: TodoItemCallbacks
|
||||
): HTMLElement {
|
||||
const itemEl = container.createEl('li', { cls: 'todo-tracker-item' });
|
||||
itemEl.setAttribute('draggable', 'true');
|
||||
itemEl.dataset.lineNumber = String(todo.lineNumber);
|
||||
|
||||
// Checkbox
|
||||
@@ -70,17 +67,6 @@ export function createTodoItemEl(
|
||||
menu.showAtMouseEvent(evt);
|
||||
});
|
||||
|
||||
// Drag events — stopPropagation so nested children don't bubble to parent
|
||||
itemEl.addEventListener('dragstart', (evt) => {
|
||||
evt.stopPropagation();
|
||||
callbacks.onDragStart(evt, todo);
|
||||
});
|
||||
|
||||
itemEl.addEventListener('dragend', (evt) => {
|
||||
evt.stopPropagation();
|
||||
callbacks.onDragEnd(evt);
|
||||
});
|
||||
|
||||
// Render children recursively
|
||||
if (todo.children.length > 0) {
|
||||
const nestedList = itemEl.createEl('ul', { cls: 'todo-tracker-nested-list' });
|
||||
|
||||
Reference in New Issue
Block a user