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

Cypress scrolls elements beyond what they're capable of #706

Closed
brian-mann opened this issue Oct 3, 2017 · 3 comments
Closed

Cypress scrolls elements beyond what they're capable of #706

brian-mann opened this issue Oct 3, 2017 · 3 comments
Labels
pkg/driver This is due to an issue in the packages/driver directory topic: scrolling ↕️

Comments

@brian-mann
Copy link
Member

brian-mann commented Oct 3, 2017

Internally Cypress uses element.scrollIntoView() to deterministically ensure we scroll elements the same way before interacting with them.

This has an unfortunate side effect. The browser will sometimes scroll the offset parents beyond what they're capable of.

Here's a demonstration.

http://jsfiddle.net/LEqjm/258/

We could switch to using element.scrollIntoView(false) else we're going to have to write our own algorithm. The above example is way too simple. Elements could be nested in scrollable containers within other scrollable containers within the window which is scrolled.

The browser normally ensures every parent is scrolled appropriately, but we'd have to implement this logic ourselves.

/cc @paulfalgout (this is the issue you've been describing)

@brian-mann brian-mann added the type: unexpected behavior User expected result, but got another label Oct 3, 2017
@paulfalgout
Copy link
Contributor

False would be an improvement at least

@jennifer-shehane
Copy link
Member

Since this issue hasn't had activity in a while, we'll close the issue until we can confirm this is still happening. Please comment if there is new information to provide concerning the original issue and we'd be happy to reopen.

@jennifer-shehane jennifer-shehane removed type: unexpected behavior User expected result, but got another stage: ready for work The issue is reproducible and in scope labels Oct 21, 2020
@paulfalgout
Copy link
Contributor

I haven't used the project in a while that it was happening on. I imagine it is still happening, but at most it was a minor annoyance on an edge case. However I don't know what the downside would be to using element.scrollIntoView(false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/driver This is due to an issue in the packages/driver directory topic: scrolling ↕️
Projects
None yet
Development

No branches or pull requests

4 participants