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

[Bug] Scrolling a control with variable row height causes visual clatter. #257

Open
windracer opened this issue Feb 14, 2024 · 0 comments
Open

Comments

@windracer
Copy link

windracer commented Feb 14, 2024

AvaloniaUI version 11.0.9 / TreeDataGrid version 11.0.2

Description

When a TreeDataGrid control has a TextColumn with the TextWrapping option set to TextWrapping.Wrap (or to TextWrapping.WrapWithOverflow), scrolling the control using the keyboard causes a visual clatter when scrolling passes through rows with wrapped text.

Tested in Windows and MacOS.

Steps to reproduce

  1. Create an empty AvaloniaUI project with TreeDataGrid control.
  2. Set the TextWrapping option of any text column to TextWrapping.Wrap
  3. Fill in the control by 100-1,000 rows or variable length.
  4. Run the app, and adjust the column width to ensure that at least one row is wrapped (the more the better).
  5. Scroll the control down by pressing and holding the Down Arrow on the keyboard.
  6. Notice that scrolling slows down on rows with wrapped text (they have larger height)
  7. You will see the visual clatter as in the video below. Otherwise, change the scrolling direction by pressing and holding the Up key.

Demo app

The sample app that recreates the bug: https://github.com/windracer/Avalonia.Controls.TreeDataGrid.VariableRowHeight.Bug

The demo app contains two TreeDataGrid controls displaying the same data.

On the left control, the text column has the TextWrapping option set to TextWrapping.NoWrap. The bug isn't reproducible.

On the right control, the text column has the TextWrapping option set to TextWrapping.Wrap. Some rows have a Height of 2× than others. The bug is reproducible.

Video illustrating the bug in action:

Avalonia.TreeDataGrid.VariableRowHeight.Bug.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant