Skip to content

Commit

Permalink
fix issue with scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthemanuel committed Nov 13, 2023
1 parent 7fce441 commit 498c394
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ _Released 11/21/2023 (PENDING)_

**Bugfixes:**

- Fixed a regression in [`13.5.0`](https://docs.cypress.io/guides/references/changelog/13.5.0) where requests cached within a given spec may take longer to load than they did previously. Addresses [#28295](https://github.com/cypress-io/cypress/issues/28295).
- We now pass a flag to Chromium browsers to disable default component extensions. This is a common flag passed during browser automation. Fixed in [#28294](https://github.com/cypress-io/cypress/pull/28294).

## 13.5.0
Expand Down
9 changes: 9 additions & 0 deletions packages/driver/cypress/e2e/commands/actions/click.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,15 @@ describe('src/cy/commands/actions/click', () => {
cy.get('html').invoke('css', 'scrollBehavior').then((scrollBehavior) => expect(scrollBehavior).to.eq('smooth'))
})

// https://github.com/cypress-io/cypress/issues/28150
it('can scroll to and click elements in html with scroll-behavior: smooth and overflow-y: auto', () => {
cy.get('html').invoke('css', 'scrollBehavior', 'smooth')
cy.get('body').invoke('css', 'overflow-y', 'auto')
cy.get('#table tr:first').click()
// Validate that the scrollBehavior is still smooth even after the actionability fixes we do
cy.get('html').invoke('css', 'scrollBehavior').then((scrollBehavior) => expect(scrollBehavior).to.eq('smooth'))
})

// https://github.com/cypress-io/cypress/issues/3200
it('can scroll to and click elements in ancestor element with scroll-behavior: smooth', () => {
cy.get('#dom').invoke('css', 'scrollBehavior', 'smooth')
Expand Down
4 changes: 2 additions & 2 deletions packages/driver/src/cy/actionability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,8 @@ const verify = function (cy, $el, config, options, callbacks: VerifyCallbacks) {
}
}

parent = $dom.getFirstScrollableParent(parent)
} while (parent)
parent = $dom.getParent(parent)
} while (parent.length)
} catch (err) {
// the above shouldn't error, but out of an abundance of caution, we
// ignore any errors since this fix isn't worth failing the test over
Expand Down

0 comments on commit 498c394

Please sign in to comment.