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

Unneeded scrolling of ancestors #635

Open
hyvyys opened this issue Sep 25, 2019 · 1 comment
Open

Unneeded scrolling of ancestors #635

hyvyys opened this issue Sep 25, 2019 · 1 comment

Comments

@hyvyys
Copy link

hyvyys commented Sep 25, 2019

https://recordit.co/z3vQ93V1YP

Scrolling the parent also scrolls another ancestor higher up the DOM tree.

I understand this is the "standard" behavior even for the browser-implemented scrollIntoView. Is there any way to prevent this? It would be useful if the method did what its name suggest ("ifNeeded").

@owaiswiz
Copy link

This might've been added after you opened this PR, but I see there's a boundary option now, which might solve the issue:

scrollIntoView(node, {
  behavior: 'smooth',
  block: 'end',
  boundary: document.getElementById('example-boundary'),
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants