@@ -174,6 +174,8 @@ export default function (Commands, Cypress, cy, state, config) {
174174 }
175175
176176 const type = function ( ) {
177+ const isFirefoxBefore98 = Cypress . isBrowser ( 'firefox' ) && Cypress . browserMajorVersion ( ) < 98
178+
177179 const simulateSubmitHandler = function ( ) {
178180 const form = options . $el . parents ( 'form' )
179181
@@ -231,11 +233,11 @@ export default function (Commands, Cypress, cy, state, config) {
231233 return
232234 }
233235
234- // In Firefox, submit event is automatically fired
236+ // Before Firefox 98 , submit event is automatically fired
235237 // when we send {Enter} KeyboardEvent to the input fields.
236238 // Because of that, we don't have to click the submit buttons.
237239 // Otherwise, we trigger submit events twice.
238- if ( ! Cypress . isBrowser ( 'firefox' ) ) {
240+ if ( ! isFirefoxBefore98 ) {
239241 // issue the click event to the 'default button' of the form
240242 // we need this to be synchronous so not going through our
241243 // own click command
@@ -274,7 +276,6 @@ export default function (Commands, Cypress, cy, state, config) {
274276
275277 const isContentEditable = $elements . isContentEditable ( options . $el . get ( 0 ) )
276278 const isTextarea = $elements . isTextarea ( options . $el . get ( 0 ) )
277- const isFirefoxBefore98 = Cypress . isBrowser ( 'firefox' ) && Cypress . browserMajorVersion ( ) < 98
278279
279280 const fireClickEvent = ( el ) => {
280281 const ctor = $dom . getDocumentFromElement ( el ) . defaultView ! . PointerEvent
0 commit comments