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

Add cy.scrollIntoView() #498

Closed
jennifer-shehane opened this issue May 15, 2017 · 2 comments
Closed

Add cy.scrollIntoView() #498

jennifer-shehane opened this issue May 15, 2017 · 2 comments
Assignees
Labels
pkg/driver This is due to an issue in the packages/driver directory type: feature New feature that does not currently exist
Milestone

Comments

@jennifer-shehane
Copy link
Member

jennifer-shehane commented May 15, 2017

Add cy.scrollIntoView() command to scroll the element found in the previous command into view.

Addresses #313

Examples:

// last ul will be scrolled into view (to top/leftmost corner)
cy.get("ul").last().scrollIntoView()

// last ul will be scrolled into view - 50px on top
cy.get("ul").last().scrollIntoView({offset: "-50px"})

// last ul will be scrolled into view + 50px on top & 50px on bottom
cy.get("ul").last().scrollIntoView({offset: {top: "50px", left: "50px";}})

//  last ul will be scrolled into view over 200ms (default is 0 ms??)
cy.get("ul").last().scrollIntoView({duration: 200})

//  last ul will be scrolled to it's center (of it's height)
cy.get("ul").last().scrollIntoView({align: "50%"})

//  last ul will be scrolled to it's very bottom
cy.get("ul").last().scrollIntoView({align: {top: "100%", left: "100%"}})
@jennifer-shehane jennifer-shehane self-assigned this May 15, 2017
@jennifer-shehane jennifer-shehane added pkg/driver This is due to an issue in the packages/driver directory type: feature New feature that does not currently exist labels May 15, 2017
@RandallKent
Copy link
Contributor

The code for this is done, but this has yet to be released. We'll update the issue and reference the changelog when it's released.

@brian-mann
Copy link
Member

Fixed in 0.20.0

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pkg/driver This is due to an issue in the packages/driver directory type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests

3 participants