Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mousemove trigger with 0 position for x or y leads to unexpected behaviour #2338

Closed
rooch84 opened this issue Aug 14, 2018 · 6 comments
Closed
Labels
stage: needs investigating Someone from Cypress needs to look at this stale no activity on this issue for a long period topic: drag-and-drop

Comments

@rooch84
Copy link

rooch84 commented Aug 14, 2018

Current behavior:

I'm trying to drag an object using the following:

cy.get(".draggable-object")
     .first()
     .trigger("mousedown", x1, y1, { which: 1 })
     .trigger("mousemove", x2, y2, {
       which: 1,
       force: true
     })
     .trigger("mouseup", x2, y2, { force: true });

x1 and y1 are an offset so I mouse down on the handler. x2 and y2 are the new position (plus the offset). When x2 or y2 are 0, instead of moving to the top or left of the element, it moves to the centre of the element (the default behaviour if no x or y are specified).

Desired behavior:

0 for x2 or y2 should place the action at either the top or left of the element (not in the centre).

Steps to reproduce:

If you need a workable demo, let me know.

Versions

Cypress 3.1.0
Windows 10

@chrisbreiding
Copy link
Contributor

A demo would be appreciated. It'll be hard to debug without being able to reproduce the issue.

@chrisbreiding chrisbreiding added the stage: awaiting response Potential fix was proposed; awaiting response label Aug 14, 2018
@rooch84
Copy link
Author

rooch84 commented Aug 14, 2018

Sorry, a bit rushed, but here it is...

https://github.com/rooch84/cypress-trigger-issue

@chrisbreiding chrisbreiding added stage: needs investigating Someone from Cypress needs to look at this and removed stage: awaiting response Potential fix was proposed; awaiting response labels Aug 14, 2018
@chrisbreiding
Copy link
Contributor

Thanks for the demo - very helpful. There's definitely something odd going on with how we set the coordinates for the events. It'll need a bit of investigation to figure out what exactly is wrong.

@sererejegede
Copy link

I'm a bit late to the party but this seems to have been forgotten...

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label May 18, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs investigating Someone from Cypress needs to look at this stale no activity on this issue for a long period topic: drag-and-drop
Projects
None yet
Development

No branches or pull requests

5 participants