mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-16 05:39:40 +02:00
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:
parent
f819b24596
commit
1bd001ec9a
2 changed files with 7 additions and 2 deletions
|
|
@ -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)}
|
||||
|
|
|
|||
|
|
@ -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 -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue