I have function for simulating DragAndDrop, if i use that i see hint but if i change position and drop it's not working.
is this even possible? I use DragTarget and DropTarget Directives
function simulateDragAndDrop(element, destination) {
const mouseDownEvent = new MouseEvent('mousedown', { bubbles: true, cancelable: true })
const mouseUpEvent = new MouseEvent('mouseup', { bubbles: true, cancelable: true })
const mouseMoveEvent = new MouseEvent('mousemove', {
bubbles: true,
cancelable: true,
clientX: destination.offsetLeft,
clientY: destination.offsetTop + destination.offsetHeight,
})
element.dispatchEvent(mouseDownEvent)
document.dispatchEvent(mouseMoveEvent)
const hint = document.querySelector('.drag-hint')
hint.style.left = `${destination.offsetLeft}px`
hint.style.top = `${destination.offsetTop + destination.offsetHeight}px`
document.dispatchEvent(mouseUpEvent)
}