Skip to content
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

Virtualize compnents adds and removes placeholders in an endless loop #38494

Closed
Liero opened this issue Nov 18, 2021 · 2 comments
Closed

Virtualize compnents adds and removes placeholders in an endless loop #38494

Liero opened this issue Nov 18, 2021 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-virtualization This issue is related to the Blazor Virtualize component ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved

Comments

@Liero
Copy link

Liero commented Nov 18, 2021

Describe the bug

screen

After upgrade to .NET 6 I see constant rerenreding of virtualize components. Placeholders being added / removed in a loop.

To Reproduce

  1. Go to: https://blazorrepl.telerik.com/mFllvCvR20mo56iv20
  2. Scroll down couple of times
  3. In developer tools, you can see the rerendering

The issue is much worse in Blazor Server side

Code:

@using Microsoft.AspNetCore.Components.Web.Virtualization;
@page "/"
<style>
    .grid-cell {
    display: flex;
    height: 50px;
    border-bottom: 1px solid;
    box-sizing:border-box;
}
</style>


<div style="height: 500px; overflow: auto">
    <Virtualize TItem="Item" ItemsProvider="GetItemsAsync" OverscanCount="0">
        <ItemContent>
            <div class="grid-cell" data-row-index="@context.id" @key="context">
                @context
            </div>
        </ItemContent>
        <Placeholder>

            <div class="grid-cell my-placeholder">
                Placeholder @context.Index; Height: @context.Size
            </div>

        </Placeholder>

    </Virtualize>
</div>

Further technical details

  • ASP.NET Core version 6:
dotnet --info Output
.NET SDK (reflecting any global.json):
 Version:   6.0.100
 Commit:    9e8b04bbff

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22000
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.100\

Host (useful for support):
  Version: 6.0.0
  Commit:  4822e3c3aa
@javiercn javiercn added area-blazor Includes: Blazor, Razor Components feature-blazor-virtualization This issue is related to the Blazor Virtualize component labels Nov 18, 2021
@mkArtakMSFT mkArtakMSFT added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Nov 18, 2021
@ghost ghost added the Status: Resolved label Nov 18, 2021
@mkArtakMSFT
Copy link
Member

Thanks for contacting us. This is a dupe of #38439

@Liero
Copy link
Author

Liero commented Nov 18, 2021

The fix is to set Oversize Count to a larger number. Usually 3 is enough

@ghost ghost locked as resolved and limited conversation to collaborators Dec 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-virtualization This issue is related to the Blazor Virtualize component ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

3 participants