-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix: send click event with cy.type('{enter}')
.
#19726
Conversation
Thanks for taking the time to open a PR!
|
packages/driver/cypress/integration/commands/actions/type_spec.js
Outdated
Show resolved
Hide resolved
// click event is only fired on button, image, submit, reset elements. | ||
// That's why we cannot use $elements.isButtonLike() here. | ||
const type = (type) => $elements.isInputType(options.$el.get(0), type) | ||
const isButtonLike = type('button') || type('image') || type('submit') || type('reset') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're not using $elements.isButtonLike()
, let's pick a different name. sendClickEvent
perhaps? Then the conditional later reads very cleanly - if (sendClickEvent && !Cypress.isBrowser('firefox'))
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think sendClickEvent
is good enough.
Thanks for working on this issue. I wanted to note that this issue also exists for The events should fire in a slightly different order
It's also important if the target changes i.e. calling I can create this in a new issue if you would prefer? |
@jamime I think there are 2 more requests in your comment.
I'll handle them in the next PR. If there are more cases I need to handle, please tell me. |
* 10.0-release: fix: restore @lmiller1990's changes feat: styling snapshots (#19972) fix bad merge overrides- GOOD CATCH TYLER! fix(unify): Updating reporter to consistently use app-provided "Preferred Editor" dialog (#19933) fix: move node 17 Check from Binary to CLI (#19977) fix: pass correct spec URL in `cypress run` on Windows (#19890) fix: send click event with `cy.type('{enter}')`. (#19726) feat: detect package manager in wizard (#19960) fix: refactor set specs by specPattern (#19953) chore: Update Chrome (beta) to 98.0.4758.74
User facing changelog
Send click event with
cy.type('{enter}')
on some button-like elements(<button>
element,button
,reset
,image
,submit
input elements)Additional details
How has the user experience changed?
Before: click event is not sent.
After: click event is sent.
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?