refactor: provider method definitions for collection reorder/move

This commit is contained in:
jamesgeorge007
2024-02-20 19:45:36 +05:30
parent 076006c4a6
commit d0c7c4a245
5 changed files with 344 additions and 3 deletions

View File

@@ -23,7 +23,7 @@
<div
class="z-[3] group pointer-events-auto relative flex cursor-pointer items-stretch"
@dragstart="dragStart"
@drop="handelDrop($event)"
@drop="handleDrop($event)"
@dragover="handleDragOver($event)"
@dragleave="resetDragState"
@dragend="
@@ -387,7 +387,7 @@ const handleDragOver = (e: DragEvent) => {
}
}
const handelDrop = (e: DragEvent) => {
const handleDrop = (e: DragEvent) => {
if (ordering.value) {
orderUpdateCollectionEvent(e)
} else if (orderingLastItem.value) {

View File

@@ -1255,7 +1255,10 @@ const dragRequest = (
requestIndex,
}: { parentCollectionIndexPath: string | null; requestIndex: string }
) => {
if (!parentCollectionIndexPath) return
if (!parentCollectionIndexPath) {
return
}
dataTransfer.setData("parentCollectionIndexPath", parentCollectionIndexPath)
dataTransfer.setData("requestIndex", requestIndex)
}