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

cy.click() internally triggers mousemove event without provided click event modifiers #28077

Closed
jasonmevans opened this issue Oct 17, 2023 · 2 comments
Labels
stale no activity on this issue for a long period

Comments

@jasonmevans
Copy link

jasonmevans commented Oct 17, 2023

Current behavior

When the click command is used, it internally dispatches a number of events, pointerover, pointerenter, mouseover, mouseenter, pointermove, mousemove. The problem is that these events are not dispatched with any of the keyboard modifiers that are passed to the click command.

  1. const moveEvents = mouse.move(fromElViewport, forceEl)
  2. pointerout()
    pointerleave()
    events.push({ type: 'pointerover', ...pointerover() })
    pointerenter()
    mouseout()
    mouseleave()
    events.push({ type: 'mouseover', ...mouseover() })
    mouseenter()
    state('mouseLastHoveredEl', $elements.isAttachedEl(el) ? el : null)
    state('mouseCoords', { x, y })
    events.push({ type: 'pointermove', ...pointermove() })
    events.push({ type: 'mousemove', ...mousemove() })

This is problematic for my project because we have some functionality that sets state on mousemove while ctrl is pressed. When the click command is used, no modifiers are passed and that causes the final mousemove event that Cypress dispatches internally to clear application state. This requires us to bypass some of our affected application code while Cypress is running, which is not ideal.

Desired behavior

Desired behavior is that the click command passes it's modifiers into mouse.move so that those modifiers are applied to the internally dispatched mouse events.

const moveEvents = mouse.move(fromElViewport, forceEl)

Test code to reproduce

https://github.com/jasonmevans/cypress-test-tiny

Cypress Version

12.11.0

Node version

v16.19.0

Operating System

13.5.2 (22G91)

Debug Logs

No response

Other

Related to this Discord thread -- https://discord.com/channels/755913899261296641/1163497683605012552

@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 Apr 15, 2024
@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 Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale no activity on this issue for a long period
Projects
None yet
Development

No branches or pull requests

2 participants