Repository navigation
Fix multiple ScrollContentPresenter.BringDescendantIntoView calls - #22001
Merged
Merged
Conversation
|
You can test this PR using the following package version. |
grokys
previously approved these changes
Aug 27, 2026
grokys
left a comment
Member
There was a problem hiding this comment.
LGTM! The only comment is a tiny nit - feel free to ignore if you don't feel it makes things clearer.
|
You can test this PR using the following package version. |
Co-authored-by: Steven Kirk <grokys@users.noreply.github.com>
grokys
approved these changes
Aug 27, 2026
MrJul
enabled auto-merge
August 27, 2026 08:15
|
You can test this PR using the following package version. |
MrJul
added a commit
to MrJul/Avalonia
that referenced
this pull request
Sep 2, 2026
…aloniaUI#22001) * Add failing test for ScrollContentPresenter * Fix ScrollContentPresenter multiple BringDescendantIntoView * Update src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs Co-authored-by: Steven Kirk <grokys@users.noreply.github.com> --------- Co-authored-by: Steven Kirk <grokys@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does the pull request do?
This PR fixes
ScrollContentPresenter.BringDescendantIntoViewnot being idempotent: calling the method several times in a row without arranging the control between the calls resulted in the offset incorrectly self-accumulating on each call.This could happen naturally, for example if a
StackPanelwas used in aComboBox(see #21973).Fixed issues
ItemFocusedmethod does not correctly scroll to the selected item when ItemsPanel uses a non-virtualizing StackPanel #21973