Skip to content

Fix DataGrid scroll chaining at layout-rounded boundaries - #256

Merged
MrJul merged 1 commit into
AvaloniaUI:mainfrom
zrt2399:fix-scroll-chaining-layout-epsilon
Aug 3, 2026
Merged

Fix DataGrid scroll chaining at layout-rounded boundaries#256
MrJul merged 1 commit into
AvaloniaUI:mainfrom
zrt2399:fix-scroll-chaining-layout-epsilon

Conversation

@zrt2399

@zrt2399 zrt2399 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Fixes DataGrid preventing scroll chaining when it has reached a vertically scrollable boundary.

At fractional render scaling, layout rounding can produce row heights that are not exactly representable. For example, a 30 DIP row becomes 30.4 DIP at 125% scaling. Accumulating these values can leave a tiny residual scrollHeight after the DataGrid reaches the bottom.

The previous exact comparison treated that residual as a valid scroll distance, causing UpdateScroll to return true and mark the input event as handled. As a result, the parent ScrollViewer could not continue scrolling.

This change compares scrollHeight against LayoutHelper.LayoutEpsilon, treating layout-level floating-point residuals as zero and allowing scroll chaining at the boundary.

@MrJul MrJul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@MrJul
MrJul merged commit ce88ee1 into AvaloniaUI:main Aug 3, 2026
1 check passed
This was referenced Aug 3, 2026
This was referenced Aug 7, 2026
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

Successfully merging this pull request may close these issues.

2 participants