-
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
Escape input event is ignored when using cy.type('{esc}')
#21313
Comments
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. |
It's been over a year, and this still doesn't seem to work. Tested on the latest version as of today (v12.12.0) |
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. |
Been 2 years now ? Can the Cypress team look into this ? |
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. |
Current behavior
If the escape key has been implemented with functionality that changes the text of an input field (i.e. hitting escape when focused on an input field clears the text in the input), this behavior is not replicated correctly when using cy.type('{esc}').
The Escape input event is being ignored at this line:
cypress/packages/driver/src/cy/keyboard.ts
Lines 1315 to 1316 in 6e03e02
because input is getting set to
false
here:cypress/packages/driver/src/cy/keyboard.ts
Lines 1264 to 1269 in 6e03e02
because the Escape event doesn't have a
text
field associaed with it soshouldUpdateValue
is returning false (even though in this specific case, we want Escape to be able to update the value).Desired behavior
cy.type('{esc}')
should simulate the same behavior experienced by the user when hitting Escape manually.Test code to reproduce
Replace
realType()
withtype()
and the test will fail.cypress/packages/app/cypress/e2e/specs_list_e2e.cy.ts
Lines 168 to 178 in 6750d33
Cypress Version
10.0.0
Other
No response
The text was updated successfully, but these errors were encountered: