Skip to content

fix: Scroll on Virtualized data in FluentDataGrid falls in infinite rendering loop #3611

@svetovid

Description

@svetovid

🐛 Bug Report

Scroll on Virtualized data in FluentDataGrid falls in infinite rendering loop.

When I as a user scroll up and down aggressively in the FluentDataGrid control, rendering breaks down and looks like on the image (often flickering).
Image

Chrome inspect tool on "Elements" tab goes crazy.
Image

💻 Repro or Code Sample

<FluentDataGrid Items=@FilteredItems
                            Virtualize="true"
...

FilteredItems is a list property containing POCO items with 2 string properties
The size of the list is about 600 items

public record CultureDataItem(string Name, string DisplayName);

private string m_NameFilter = string.Empty;
    
public IQueryable<CultureDataItem> Content { get; set; } = CultureInfo.GetCultures(CultureTypes.SpecificCultures).Select(x => new CultureDataItem(x.Name, x.DisplayName)).AsQueryable();

private IQueryable<CultureDataItem>? FilteredItems
    => Content.Where(x => x.DisplayName.Contains(m_NameFilter, StringComparison.OrdinalIgnoreCase));

🤔 Expected Behavior

Data loads quicker and renders smoother

😯 Current Behavior

It gets stuck on rendering FluentDataGrid items while scrolling, when Virtualization is enabled

🌍 Your Environment

An app running in WebView2 control
WebView2 127.0.2651.86
.NET 8.0.11
Microsoft.FluentUI.AspNetCore.Components 4.11.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions