Skip to content

Commit

Permalink
Merge branch 'develop' into tbiethman/chore/issue-21068-electron-bump
Browse files Browse the repository at this point in the history
  • Loading branch information
tbiethman authored Apr 14, 2022
2 parents c36eb7f + e5002f0 commit 92e586a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/driver/src/cy/commands/actions/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ export default function (Commands, Cypress, cy, state, config) {
}

const type = function () {
const isFirefoxBefore98 = Cypress.isBrowser('firefox') && Cypress.browserMajorVersion() < 98

const simulateSubmitHandler = function () {
const form = options.$el.parents('form')

Expand Down Expand Up @@ -231,11 +233,11 @@ export default function (Commands, Cypress, cy, state, config) {
return
}

// In Firefox, submit event is automatically fired
// Before Firefox 98, submit event is automatically fired
// 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')) {
if (!isFirefoxBefore98) {
// issue the click event to the 'default button' of the form
// we need this to be synchronous so not going through our
// own click command
Expand Down Expand Up @@ -274,7 +276,6 @@ export default function (Commands, Cypress, cy, state, config) {

const isContentEditable = $elements.isContentEditable(options.$el.get(0))
const isTextarea = $elements.isTextarea(options.$el.get(0))
const isFirefoxBefore98 = Cypress.isBrowser('firefox') && Cypress.browserMajorVersion() < 98

const fireClickEvent = (el) => {
const ctor = $dom.getDocumentFromElement(el).defaultView!.PointerEvent
Expand Down

0 comments on commit 92e586a

Please sign in to comment.