fixed widget dragging inside the canvas

This commit is contained in:
paul
2024-09-17 11:55:21 +05:30
parent 0f755b7a90
commit d3721f2ea2
7 changed files with 214 additions and 36 deletions

View File

@@ -7,7 +7,7 @@ import { useDragContext } from "./draggableContext"
* @param {string} - dragElementType - this will set the data-draggable-type which can be accessed on droppable to check if its allowed or not
* @returns
*/
const DraggableWrapper = memo(({dragElementType, className, children}) => {
const DraggableWrapper = memo(({dragElementType, className, children, ...props}) => {
const { onDragStart, onDragEnd } = useDragContext()
@@ -40,6 +40,7 @@ const DraggableWrapper = memo(({dragElementType, className, children}) => {
onDragStart={handleDragStart}
onDragEnd={handleDragEnd}
ref={draggableRef}
{...props}
>
{children}
</div>