Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbreiding committed Sep 7, 2023
1 parent 8939182 commit 63a00ca
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions packages/driver/src/cy/commands/actions/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,16 +354,17 @@ export default function (Commands, Cypress, cy, state, config) {

if (
(
// Before Firefox 91,
// Firefox sends a click event when the Space key is pressed.
// We don't want to send it twice.
// Before Firefox 91, it sends a click event automatically on the
// 'keyup' event for a Space key and we don't want to send it twice
!Cypress.isBrowser('firefox') ||
// After Firefox 91,
// click events are automatically sent for <input> elements (up until Firefox 98).
// On or after Firefox 91, click events are not automatically sent if the element is an <button>.
// event.target is null when used with shadow DOM.
(!isFirefoxBefore98 && event.target && $elements.isInput(event.target)) ||
(!isFirefoxBefore91 && event.target && $elements.isButton(event.target))
// Starting with Firefox 91, click events are no longer sent
// automatically for <button> elements
// event.target is null when the element is within the shadow DOM
(!isFirefoxBefore91 && event.target && $elements.isButton(event.target)) ||
// Starting with Firefox 98, click events are no longer sent
// automatically for <input> elements
// event.target is null when the element is within the shadow DOM
(!isFirefoxBefore98 && event.target && $elements.isInput(event.target))
) &&
// Click event is sent after keyup event with space key.
event.type === 'keyup' && event.code === 'Space' &&
Expand Down Expand Up @@ -443,16 +444,17 @@ export default function (Commands, Cypress, cy, state, config) {
// Send click event on type('{enter}')
if (sendClickEvent) {
if (
// Before Firefox 98, it sends a click event automatically.
// Before Firefox 98, it sends a click event automatically on
// simulated keypress events and we don't want to send it twice
!Cypress.isBrowser('firefox') ||
// After Firefox 98,
// click event are automatically sent if the element is a <button> (Up until Firefox 106)
// click events do not automatically send if the element is an <input>
// Starting with Firefox 98, click events are no longer sent
// automatically for <input> elements, but are still sent for
// other element types
(!isFirefoxBefore98 && $elements.isInput(el)) ||

// On or After Firefox 106 click events are not automatically sent on 'enter'
// when the element is a <button>
(isFirefox106OrLater && $elements.isButton(el))) {
// Starting with Firefox 106, click events are no longer sent
// automatically for <button> elements
(isFirefox106OrLater && $elements.isButton(el))
) {
fireClickEvent(el)
}
}
Expand Down

5 comments on commit 63a00ca

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 63a00ca Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.2.0/linux-x64/chore/update_electron25_and_node18-63a00ca8770b4ce95c652ed378a73446b100996c/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 63a00ca Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.2.0/linux-arm64/chore/update_electron25_and_node18-63a00ca8770b4ce95c652ed378a73446b100996c/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 63a00ca Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.2.0/darwin-arm64/chore/update_electron25_and_node18-63a00ca8770b4ce95c652ed378a73446b100996c/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 63a00ca Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.2.0/darwin-x64/chore/update_electron25_and_node18-63a00ca8770b4ce95c652ed378a73446b100996c/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 63a00ca Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.2.0/win32-x64/chore/update_electron25_and_node18-63a00ca8770b4ce95c652ed378a73446b100996c/cypress.tgz

Please sign in to comment.