You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ScrollViewer not scrolling to end with bottom padding... #17158
Ah I see. DataGrid doesn't work well inside a ScrollViewer which is by design. It's due to virtualization and performance reasons. So either move the dg outside of the scrollviewer or consider to use a different control like ListBox or ItemsControl. TreeDataGrid might work but never tried it yet.
@trashhacker I hope dude was meant just nice in this context and not disrespectful!
We will not debug your App on tab 3 of a larger App. If you have an issue, make the sample to reproduce as small as it can be. Not somewhere in this or that region of the App.... Sorry but we don't have enough time to debug bigger Apps. If you have a support agreement that may be a different thing.
@trashhacker just to make sure we're on the same line, we can have different opinions and we can have misunderstandings, but we all should be kind to each other. Your recent comment is how community can and should work together 👍🤗.
Hi, I just hit this same problem and I have also found an older issue, that was closed without resolving the main problem.
I am working on a custom control and I am debugging its behaviour in ScrollViewer for two days, that it can't be fully scrolled to the bottom. The issue, as reported here, is in the ScrollViewer in the end.
The problem looks to be when the ScrollViewer calls Measure on its child. In my custom control the reported availableSize in protected override Size MeasureOverride(Size availableSize) is the ScrollViewer's size, instead of the size available for the content i.e., without all the ScrollViewer's paddings.
Workaround is to add the padding onto the content of the ScrollViewer, when possible.
@timunie I am sorry, I am just debugging my own custom control misbehaving in ScrollViewer. I am not familiar with Avalonia codebase to be able to create a good PR with a fix :( I wanted to open a new issue with this behaviour, but I found this opened issue, so I am providing more information of what is happening, to give Avalonia devs more hints of what could be wrong.
I am using Avalonia 11.3.7.
Hope this will also link the older issue into this one #12182
I digged a bit deeper into this, because I wasn't sure if the problem is the ScrollViewer or the Fluent theme I am using. I didn't find any measure code in ScrollViewer, so I checked the template in Fluent theme.
Maybe the problem is in the ScrollContentPresenter, that is used by Fluent theme? Its ScrollViewer template sets the padding from template binding onto the ScrollContentPresenter, but I don't see the Padding being used when measuring? Maybe the problem is here? Where it doesn't subtract padding? Just guessing.
var constraint = new Size(
CanHorizontallyScroll ? double.PositiveInfinity : availableSize.Width,
CanVerticallyScroll ? double.PositiveInfinity : availableSize.Height);
Activity
timunie commentedon Oct 2, 2024
Can't reproduce with vanilla Avalonia-FluentTheme. Do you use any custom Theme?
trashhacker commentedon Oct 3, 2024
look at my repro, no im using the default FluentTheme atm or forever idk yet
the last row schould be red but its not visible and with a padding of 100 at bottum i should have a gap bottom.
https://github.com/trashhacker/Avalonia.Repro.git
timunie commentedon Oct 4, 2024
Ah I see. DataGrid doesn't work well inside a ScrollViewer which is by design. It's due to virtualization and performance reasons. So either move the dg outside of the scrollviewer or consider to use a different control like ListBox or ItemsControl. TreeDataGrid might work but never tried it yet.
trashhacker commentedon Oct 4, 2024
Dude it is a stackpanel!!
3red tab, maybe i forgot to publish it
Currently in the way... Doing it later today
timunie commentedon Oct 4, 2024
@trashhacker I hope dude was meant just nice in this context and not disrespectful!
We will not debug your App on tab 3 of a larger App. If you have an issue, make the sample to reproduce as small as it can be. Not somewhere in this or that region of the App.... Sorry but we don't have enough time to debug bigger Apps. If you have a support agreement that may be a different thing.
Thanks for your understanding.b
trashhacker commentedon Oct 4, 2024
Sure it was, but im Not an Idiot at all thats a Bug in Scrollviewer If i dont see the Last Line, neither the padding
Hmm OK thought would be a good Idee to collect the issues in one repro and Not makind x of them for every issue
ITS Not as bog as you think Just 3 tabs
timunie commentedon Oct 9, 2024
Thank you, I updated the issue labels accordingly. Indeed, looks like Padding is calculated wrong for ScrollViewer 🤔
trashhacker commentedon Oct 9, 2024
I thank u for your great work with Avalonia and your fast support, im sorry for any disagreements
timunie commentedon Oct 9, 2024
@trashhacker just to make sure we're on the same line, we can have different opinions and we can have misunderstandings, but we all should be kind to each other. Your recent comment is how community can and should work together 👍🤗.
martinflorek commentedon Nov 2, 2025
Hi, I just hit this same problem and I have also found an older issue, that was closed without resolving the main problem.
I am working on a custom control and I am debugging its behaviour in ScrollViewer for two days, that it can't be fully scrolled to the bottom. The issue, as reported here, is in the ScrollViewer in the end.
The problem looks to be when the ScrollViewer calls Measure on its child. In my custom control the reported
availableSizeinprotected override Size MeasureOverride(Size availableSize)is the ScrollViewer's size, instead of the size available for the content i.e., without all the ScrollViewer's paddings.Workaround is to add the padding onto the content of the ScrollViewer, when possible.
timunie commentedon Nov 2, 2025
@martinflorek if you are already investing the issue, feel free to open a PR.
martinflorek commentedon Nov 2, 2025
@timunie I am sorry, I am just debugging my own custom control misbehaving in ScrollViewer. I am not familiar with Avalonia codebase to be able to create a good PR with a fix :( I wanted to open a new issue with this behaviour, but I found this opened issue, so I am providing more information of what is happening, to give Avalonia devs more hints of what could be wrong.
I am using Avalonia 11.3.7.
Hope this will also link the older issue into this one #12182
martinflorek commentedon Nov 3, 2025
I digged a bit deeper into this, because I wasn't sure if the problem is the ScrollViewer or the Fluent theme I am using. I didn't find any measure code in ScrollViewer, so I checked the template in Fluent theme.
Maybe the problem is in the ScrollContentPresenter, that is used by Fluent theme? Its ScrollViewer template sets the padding from template binding onto the ScrollContentPresenter, but I don't see the Padding being used when measuring? Maybe the problem is here? Where it doesn't subtract padding? Just guessing.
timunie commentedon Nov 3, 2025
@martinflorek as I said, feel free to open a PR. Don't worry, someone will carefully check it before merging :-)
martinflorek commentedon Nov 10, 2025
@timunie here is my attempt at fixing this bug #20025. I am still not 100% sure if that is all that is needed to fix this scrolling problem.
Date the ScrollViewer rule, and stop claiming a scroll that never hap…
Fix three faults in the About box, one of them a trap worth naming (#937