fix: draggable nur auf Folder-Icon, Rechtsklick funktioniert wieder
This commit is contained in:
@@ -86,13 +86,6 @@ function TreeItem({
|
|||||||
{/* Folder header - drop target */}
|
{/* Folder header - drop target */}
|
||||||
{!isRoot && (
|
{!isRoot && (
|
||||||
<div
|
<div
|
||||||
draggable
|
|
||||||
onDragStart={(e) => {
|
|
||||||
if (e.button !== 0) { e.preventDefault(); return; }
|
|
||||||
e.dataTransfer.setData('text/plain', `folder:${node.folder!.id}`);
|
|
||||||
e.dataTransfer.effectAllowed = 'move';
|
|
||||||
onDragFolder(node.folder!.id);
|
|
||||||
}}
|
|
||||||
onDragOver={handleDragOver}
|
onDragOver={handleDragOver}
|
||||||
onDragLeave={() => setIsDragOver(false)}
|
onDragLeave={() => setIsDragOver(false)}
|
||||||
onDrop={handleDrop}
|
onDrop={handleDrop}
|
||||||
@@ -107,9 +100,20 @@ function TreeItem({
|
|||||||
<svg className={clsx('w-4 h-4 transition-transform', expanded && 'rotate-90')} fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<svg className={clsx('w-4 h-4 transition-transform', expanded && 'rotate-90')} fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
|
||||||
</svg>
|
</svg>
|
||||||
<svg className="w-4 h-4 text-secondary-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<span
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" />
|
draggable
|
||||||
</svg>
|
onDragStart={(e) => {
|
||||||
|
e.dataTransfer.setData('text/plain', `folder:${node.folder!.id}`);
|
||||||
|
e.dataTransfer.effectAllowed = 'move';
|
||||||
|
onDragFolder(node.folder!.id);
|
||||||
|
}}
|
||||||
|
className="cursor-grab active:cursor-grabbing flex items-center"
|
||||||
|
title="Ordner verschieben"
|
||||||
|
>
|
||||||
|
<svg className="w-4 h-4 text-secondary-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
<span className="flex-1 truncate">{node.folder!.name}</span>
|
<span className="flex-1 truncate">{node.folder!.name}</span>
|
||||||
<button onClick={(e) => { e.stopPropagation(); onContextMenu(e, 'folder', node.folder!.id); }} className="opacity-0 group-hover:opacity-100 text-secondary-400 hover:text-primary-600 p-0.5" title="Umbenennen">
|
<button onClick={(e) => { e.stopPropagation(); onContextMenu(e, 'folder', node.folder!.id); }} className="opacity-0 group-hover:opacity-100 text-secondary-400 hover:text-primary-600 p-0.5" title="Umbenennen">
|
||||||
<svg className="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg>
|
<svg className="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg>
|
||||||
|
|||||||
Reference in New Issue
Block a user