Skip to content

[Blazor] Virtualization does not work with web components #44357

@czdietrich

Description

@czdietrich

Describe the bug

Blazor's Virtualize component tries to find the surrounding scroll container by moving up the elements tree and look for an element where overflow-y != visible. (see here)

Unfortunately that way it will not find scrollable containers within web components, since it never checks for the shadow root on any element.

Expected Behavior

Virtualization should also just work for custom scroll containers that are built using web components.

pseudo html:

<div> <my-custom-scroll-viewer> <!-- shadow root contains an element with vertical overflow --> <Virtualize Items="..." /> </my-custom-scroll-viewer> </div>

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

6.0.400

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-virtualizationThis issue is related to the Blazor Virtualize component

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions