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

type('{enter}') does not fire click event #19541

Closed
jamime opened this issue Jan 4, 2022 · 3 comments · Fixed by #19726
Closed

type('{enter}') does not fire click event #19541

jamime opened this issue Jan 4, 2022 · 3 comments · Fixed by #19726

Comments

@jamime
Copy link

jamime commented Jan 4, 2022

Current behavior

When the target element is a button type('{enter}') fires the events

  • keydown
  • keypress
  • keyup

image
Note the first "click" is from activating the button.

Desired behavior

When the target element is a button type('{enter}') should fire the events

  • keydown
  • keypress
  • click
  • keyup

image

Note the first "click" is from activating the button.

Test code to reproduce

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

Cypress Version

9.2.0

Other

If the key is the Enter or key and the current focus is on a state-changing element, the default action MUST be to dispatch a click event, and a DOMActivate event if that event type is supported by the user agent (refer to § 3.5 Activation triggers and behavior for more details)

https://w3c.github.io/uievents/#event-type-keydown

Once the cypress test has failed, if you click "reset", then click the second button and press "Enter" you will see the correct output.

@mjhenkes
Copy link
Member

mjhenkes commented Jan 5, 2022

@jamime, Thanks for the reproducible repo. I've confirmed this is an issue in 9.2.0

@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: ready for work The issue is reproducible and in scope labels Jan 17, 2022
@cypress-bot cypress-bot bot added stage: waiting stage: needs review The PR code is done & tested, needs review and removed stage: needs review The PR code is done & tested, needs review stage: waiting labels Jan 25, 2022
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Jan 31, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 31, 2022

The code for this is done in cypress-io/cypress#19726, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 31, 2022

Released in 9.4.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v9.4.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants