dotnet / dotnet/aspnetcore

[Blazor] Virtualization does not work with web components

Open
#44,357 9 comments 2 reactions 0 assignees View on GitHub
area-blazor enhancement feature-blazor-virtualization
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### 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](https://github.com/dotnet/aspnetcore/blob/main/src/Components/Web.JS/src/Virtualize.ts#L33))

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:
```html






```

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### .NET Version

6.0.400

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.