-
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: cy.type('{enter}') on <input> elements submits the form correctly after Firefox 98. #21042
Conversation
Thanks for taking the time to open a PR!
|
NoteOur CI uses Firefox 93. This PR should be tested manually. |
@sainthkh Thanks for looking into this again! |
@@ -235,7 +237,8 @@ export default function (Commands, Cypress, cy, state, config) { | |||
// when we send {Enter} KeyboardEvent to the input fields. | |||
// Because of that, we don't have to click the submit buttons. | |||
// Otherwise, we trigger submit events twice. | |||
if (!Cypress.isBrowser('firefox')) { | |||
// But after Firefox 98, submit event isn't automatically fired. | |||
if (!isFirefoxBefore98 || !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.
The second part of this conditional is redundant. Three cases:
FF 97: (!true || !true) == false
FF 98: (!false || !true) == true
Chromium: (!false || !false) == true
In every case, !Cypress.isBrowser('firefox')
has no effect on the outcome (because it's already part of the "is FF before 98" check).
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.
You're right.
isFirefoxBefore98
is isFirefox && version < 98
.
!isFirefoxBefore98 || !isFirefox
is !isFirefox || !(version < 98) || !isFirefox
.
I fixed it.
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.
Tested against local FF98, the related tests pass after changes 👍
…e-config * 10.0-release: fix: make error on integration folder point to e2e (#20853) fix(unify): Update Cypress Dashboard Service Link in Login Modal (#21084) chore: fix windows node_modules install step (#21098) fix: webpack integration tests for app w webpack-dev-server-fresh (#21093) fix: move non spec files on migration (#21054) Bumping electron version in root chore(deps): Bumping electron dependency to 15.5.1 (#21072) fix: resolves correctly specPattern (#21057) feat: replace reconfigure button on settings page with link to config doc (#21077) feat(launchpad): update CT setup and config scaffolding (#20893) fix: cy.type('{enter}') on <input> elements submits the form correctly after Firefox 98. (#21042) chore: making the npm deps for vue, react, and vue2 use 0.0.0-dev (#21081) fix(cli): show additional mitigation steps for max path length error (#21047) fix: Plugin error when sending on disconnected IPC channel (#21011) chore: add internal types for cy.session command (#21028) chore: Update Chrome (stable) to 100.0.4896.88 (#21043)
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
{enter}
not working in Firefox 99 and 100 #21033User facing changelog
cy.type('{enter}') submits the form correctly after Firefox 98.
Additional details
Enter
event behavior change in Firefox 98 causedcy.type('{enter}')
to not submit the<form>
s.How has the user experience changed?
<form>
is submitted correctly withcy.type('{enter}')
.PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?