Open BillyTom opened 11 months ago
I'm experiencing the same on cypress 13.5.1. "dropend" event never triggers once the element has been dragged over to the target.
I'm only seeing the following:
triggerdragover, Object{5} triggermousemove, Object{4} triggerpointermove, Object{4}
Currently using @4tw/cypress-drag-drop@2.2.5
As a quick and dirty workaround, it seems to work when I force a mouse-up event after the initial drag. The only issue is that you can't then assert the success of the "drag and drop" action using its '.then((status) => {})' chained method.
e.g.:
cy.get(elementToDrag).drag(targetDropzone, {
target: { position: 'center' },
force: true
})
// Then add the below to force the end of the action
cy.get(targetDropzone).trigger('mouseup', { force: true })
Probably related to #18, but I created a new issue since the other is more the two years old.
Sometimes the event "dragend" or "drop" is not emitted. This means that the drag operation is not completed successfully, but no error is emitted.
I co-opted the page simple-drag-drop.glitch.me to create a test case to reproduce the issue:
This test fails to re-order the elements ABC:
Log entry:
The events "dragstart" and "dragover" are emitted, but no "dragend" or "drop".
I copied a second test from this blog post that uses drag & drop with native javascript:
This second test works: