Skip to content

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

Open
@jclijmans

Description

@jclijmans

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions