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

Comments

@brian-mann
Copy link
Member

@brian-mann 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)

@paulfalgout
Copy link
Contributor

@paulfalgout paulfalgout commented Oct 3, 2017

False would be an improvement at least

@jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Oct 21, 2020

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.

@paulfalgout
Copy link
Contributor

@paulfalgout paulfalgout commented Oct 21, 2020

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants