fix(manacore/web): restrict page drag to handle only, allow item DnD

Page reorder drag now only starts from the drag-handle icon, not from
anywhere in the page. This allows dragSource on list items (tasks,
events, contacts) to work without being intercepted by page reorder.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-03 13:11:58 +02:00
parent f819b24596
commit 1bd001ec9a
2 changed files with 7 additions and 2 deletions

View file

@ -52,6 +52,12 @@
let dragId = $state<string | null>(null);
function handleDragStart(e: DragEvent, id: string) {
// Only allow page reorder drag from the drag-handle, not from items inside the page
const target = e.target as HTMLElement;
if (!target.closest('.drag-handle')) {
e.preventDefault();
return;
}
dragId = id;
if (e.dataTransfer) {
e.dataTransfer.effectAllowed = 'move';
@ -94,7 +100,6 @@
<div
class="page-drag-wrapper"
class:dragging={dragId === p.id}
draggable={true}
ondragstart={(e) => handleDragStart(e, p.id)}
ondragover={handleDragOver}
ondrop={(e) => handleDrop(e, p.id)}

View file

@ -114,7 +114,7 @@
: ''}"
>
<div class="drag-handle-bar">
<span class="drag-handle"><DotsSixVertical size={14} /></span>
<span class="drag-handle" draggable="true"><DotsSixVertical size={14} /></span>
</div>
<!-- Header -->