Remove drag and drop entirely

This commit is contained in:
2026-02-20 15:45:31 -08:00
parent a00b96231c
commit 1cbc127769
7 changed files with 227 additions and 281 deletions

View File

@@ -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' });