feat: added sidebar widget drop

fix: corrected color picker value, drag and drop
This commit is contained in:
paul
2024-09-22 12:39:03 +05:30
parent a440b46e9b
commit 740a5400f8
13 changed files with 164 additions and 158 deletions

View File

@@ -16,7 +16,6 @@ const WidgetDraggable = memo(({ widgetRef, enableDrag=true, dragElementType="wid
onDragEnter, onDragLeave, onDrop, style={},
droppableTags = ["widget"], ...props }) => {
// FIXME: It's not possible to move the widget ~10px because, its considered as self drop, so fix it
// const { draggedElement, onDragStart, onDragEnd } = useDragWidgetContext()
const { draggedElement, onDragStart, onDragEnd, overElement, setOverElement } = useDragContext()
@@ -61,7 +60,6 @@ const WidgetDraggable = memo(({ widgetRef, enableDrag=true, dragElementType="wid
const dragEleType = draggedElement.getAttribute("data-draggable-type")
// console.log("Drag entering...", overElement === e.currentTarget)
// FIXME: the outer widget shouldn't be swallowed by inner widget
if (draggedElement === widgetRef.current){
// prevent drop on itself, since the widget is invisible when dragging, if dropped on itself, it may consume itself
return