Drag and drop with jquery ui sortable
See original GitHub issue- Operating System: Mac os
- Cypress Version: last version
- Browser Version: Chrome and Electron
Hello,
I’m trying to use Cypress to test a drag and drop sort (jquery ui sortable). It seems not working here. Is there an example? I tried this without success :
cy.get(".grip").first().trigger('mouseover')
.trigger('mousedown', { which: 1 })
.trigger('mousemove', {clientX: 600, clientY: 600})
.trigger('mouseup', {force: true});
.grip
is the handle. The parent (tr
) is the draggable element.
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Sortable | jQuery UI
Enable a group of DOM elements to be sortable. Click on and drag an element to a new spot within the list, and...
Read more >Jquery UI combine sortable and draggable - Stack Overflow
Both drag'n drop and sortable functions shares the droppable:drop function. When sorting elements, the function has to replace the selected ...
Read more >Drag and Drop Element with JQuery UI Sortable - Phpflow.com
Step 2: We will Define HTML Structure or HTML view file to show drag and drop elements list.HTML structure of jQuery UI Sortable...
Read more >Drag and drop with jQuery UI Sortable - Simon Battersby
Using jQuery UI Sortable to change the sort order of a list of items via a drag and drop interface.
Read more >Web Design: Drag and Drop with jQuery UI Sortable - Hongkiat
This particular plugin will enable a group of DOM to be sortable, meaning that we are able to move the object from one...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This worked for me:
I experimented with this a bit and I think I’ve figured out what jQuery UI needs to simulate drag-n-drop. It requires
pageX
andpageY
instead of theclient*
equivalents. It requires them for themousedown
as well as themousemove
and requireswhich: 1
for themousemove
. It should look like this:You just need to make sure the
pageX
andpageY
values actually line up with where your element is formousedown
and where you need it to be dropped formousemove
.