Skip to content

Commit bcba5ed

Browse files
committed
fix: fix checkbox click events for firefox 129 and up [run ci]
1 parent 8eb40d0 commit bcba5ed

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

cli/CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
22
## 13.14.3
33

4-
_Released 9/10/2024 (PENDING)_
4+
_Released 9/24/2024 (PENDING)_
5+
6+
**Bugfixes:**
7+
8+
- Fixed an issue where Firefox was incorrectly mutating the state of click events on checkboxes after Firefox version `129` and up. Addressed in [#30245](https://github.com/cypress-io/cypress/pull/30245).
59

610
**Dependency Updates:**
711

packages/driver/src/cy/commands/actions/type.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export default function (Commands, Cypress, cy, state, config) {
192192
const isFirefoxBefore91 = Cypress.isBrowser('firefox') && Cypress.browserMajorVersion() < 91
193193
const isFirefoxBefore98 = Cypress.isBrowser('firefox') && Cypress.browserMajorVersion() < 98
194194
const isFirefox106OrLater = Cypress.isBrowser('firefox') && Cypress.browserMajorVersion() >= 106
195-
const isFirefox130OrLater = Cypress.isBrowser('firefox') && Cypress.browserMajorVersion() >= 130
195+
const isFirefox129OrLater = Cypress.isBrowser('firefox') && Cypress.browserMajorVersion() >= 129
196196

197197
const simulateSubmitHandler = function () {
198198
const form = options.$el.parents('form')
@@ -386,10 +386,9 @@ export default function (Commands, Cypress, cy, state, config) {
386386

387387
keydownEvents = []
388388

389-
// After Firefox 98 and before 130
389+
// After Firefox 98 and before 129
390390
// Firefox doesn't update checkbox automatically even if the click event is sent.
391-
// TODO: verify firefox version this starts happening
392-
if (Cypress.isBrowser('firefox') && !isFirefox130OrLater) {
391+
if (Cypress.isBrowser('firefox') && !isFirefox129OrLater) {
393392
if (event.target.type === 'checkbox') {
394393
event.target.checked = !event.target.checked
395394
} else if (event.target.type === 'radio') { // when checked is false, here cannot be reached because of the above condition

packages/server/lib/browsers/firefox.ts

+2
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,8 @@ export async function open (browser: Browser, url: string, options: BrowserLaunc
415415
'-marionette',
416416
'-new-instance',
417417
'-foreground',
418+
// if testing against older versions of Firefox to determine when a regression may have been introduced, uncomment the '-allow-downgrade' flag.
419+
// '-allow-downgrade',
418420
'-start-debugger-server', // uses the port+host defined in devtools.debugger.remote
419421
'-no-remote', // @see https://github.com/cypress-io/cypress/issues/6380
420422
],

0 commit comments

Comments
 (0)