Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not throw error when using scrollTo on non-scrollable elements #1924

Closed
Clem-D opened this issue Jun 11, 2018 · 4 comments · Fixed by #8003
Closed

Do not throw error when using scrollTo on non-scrollable elements #1924

Clem-D opened this issue Jun 11, 2018 · 4 comments · Fixed by #8003
Assignees
Labels
good first issue Good for newcomers pkg/driver This is due to an issue in the packages/driver directory type: unexpected behavior User expected result, but got another

Comments

@Clem-D
Copy link

Clem-D commented Jun 11, 2018

Current behavior:

When someone using "scrollTo" on a non-scrollable element we get the following error :

Error: CypressError: Timed out retrying: cy.scrollTo() failed because this element is not scrollable: <window>

Desired behavior:

No error. It just does nothing.
I use scrollTo on an element which can contain sometimes 0 and sometimes +100 elements. So I don't know by advance if the window will be scrollable or not...
It could be nice to not have any error or having an option to bypass this error.

Versions

  • Cypress : 2.1.0
  • OS : CentOS Linux release 7.5.1804 (Core)
  • Browser : Google Chrome version 67
@jennifer-shehane jennifer-shehane added stage: proposal 💡 No work has been done of this issue difficulty: 1️⃣ pkg/driver This is due to an issue in the packages/driver directory type: unexpected behavior User expected result, but got another labels Jan 25, 2019
@hieuTranEnouvo

This comment has been minimized.

@jennifer-shehane jennifer-shehane added the good first issue Good for newcomers label Feb 18, 2020
@jennifer-shehane jennifer-shehane changed the title scrollTo should not fail Do not throw error when using scrollTo on non-scrollable elements Jul 9, 2020
@jennifer-shehane
Copy link
Member

jennifer-shehane commented Jul 9, 2020

Repro:

<html>
<body>
</body>
</html>
it('does not error on scroll', () => {
  cy.visit('index.html')
  cy.scrollTo(0, 500)  
})

Screen Shot 2020-07-17 at 12 04 00 PM

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Jul 20, 2020

The code for this is done in cypress-io/cypress#8003, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@jennifer-shehane jennifer-shehane added stage: pending release and removed stage: proposal 💡 No work has been done of this issue labels Jul 20, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 21, 2020

Released in 4.11.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v4.11.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jul 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers pkg/driver This is due to an issue in the packages/driver directory type: unexpected behavior User expected result, but got another
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants