Skip to content

After update to v2.0.0, scrollIntoView does not work anymore for element in shadow dom #1042

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

Open
jclijmans opened this issue Mar 10, 2023 · 0 comments

Comments

@jclijmans
Copy link

jclijmans commented Mar 10, 2023

After I've updated to version 2.0.0, the scrollIntoView method does not scroll anymore for an element in a web component (shadow dom)

No error is shown in the console, the element isn't scrolled to.

The call that I do is

  await scrollIntoView(element, {
    behavior: "smooth",
    block: "start",
    scrollMode: "always",
  });

It used to work in version 1.1.33

scrollIntoView works fine for elements not in shadowdom.

It seems to be this commit in scoll-into-view-if-needed that causes the logic to be broken for shadow dom. @nachoab365 commented about it, but the commit got in anyway.

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

1 participant