Skip to content

[cssom-view] Should scrollParent allow axis filtering? #12731

@Loirooriol

Description

@Loirooriol

#12289 allows boxes to only be scrollable in one axis.

So I suspect authors may want to query the scroll container that is scrollable in a specific axis.

Maybe they can just do

let scrollParent = element.scrollParent;
while (scrollParent) {
  if (getComputedStyle(scrollParent).overflowY != "clip") {
    break;
  }
  scrollParent = scrollParent.scrollParent;
}

But should we instead allow something like element.scrollParent({axis: "y"})?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions