Skip to content

fix: Results jump around when scrolling in FluentDataGrid #4058

@JamesNK

Description

@JamesNK

🐛 Bug Report

I have a data grid with a lot of items and virtualize is enabled. I see bad behavior when I use the mouse wheel to scroll up or down. The position of the scroll bar and the results of the data grid jump around randomly while scrolling.

💻 Repro or Code Sample

  1. Clone https://github.com/dotnet/aspire.git
  2. Open Aspire.slnx
  3. Run the Stress.AppHost project that is in the playground folder
  4. The dashboard runs. Click the ... button in the Actions column for the stress-apiservice resource and choose Log message limit. This writes 10,000 logs.
  5. Click on Structured logs page and scroll up and down in the data grid.
  6. Results jump around while scrolling.

🤔 Expected Behavior

Scroll position and results shouldn't jump around

😯 Current Behavior

I create all the logs, then I scroll up for a while (lots of jumping), then I scroll down (lots of jumping)

datagrid-scroll-jumping.mp4

💁 Possible Solution

I've double checked that grid items have a consistent height: ItemSize="46".
Also, I've check that the GetData is consistently returning the right total item count while scrolling (I assume the overall scroll height is based on this value)

Adding a large overscan to the data grid (i.e. 100) improves scrolling a lot. However, the results will still jump around if you scroll very quickly.

🔦 Context

🌍 Your Environment

  • OS & Device: [e.g. MacOS, iOS, Windows, Linux] on [iPhone 7, PC]
  • Browser [e.g. Microsoft Edge, Google Chrome, Apple Safari, Mozilla FireFox]
  • .NET and Fluent UI Blazor library Version [e.g. 8.0.2 and 4.4.1]

Metadata

Metadata

Assignees

Labels

needs: author feedbackThe author of this issue needs to respond in order for us to continue investigating this issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions