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

Fixes #16346 #16347

Merged
merged 1 commit into from
Aug 30, 2024
Merged

Fixes #16346 #16347

merged 1 commit into from
Aug 30, 2024

Conversation

mpylon
Copy link
Contributor

@mpylon mpylon commented Jul 17, 2024

What does the pull request do?

This PR prevents recycled elements from being used as anchors by ScrollContentPresenter in the case that those elements have not been arranged before EnsureAnchorElementSelection is called.

What is the current behavior?

Currently, emitting a Reset event causes items to be recycled without removing them as anchor candidates. This causes the incorrect element to be selected as an anchor element when arranging ScrollContentPresenter. This incorrect anchor element is then interpreted as a change in offset, causing the ScrollViewer to scroll more than intended.

What is the updated/expected behavior with this PR?

This can be tested with the following sample repository.

https://github.com/mpylon/ava-virtualization/tree/master

Fixed issues

Fixes #16346

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0050190-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Jul 17, 2024

  • All contributors have signed the CLA.

@maxkatz6 maxkatz6 requested a review from grokys July 17, 2024 00:50
@maxkatz6 maxkatz6 added bug backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Jul 17, 2024
@mpylon
Copy link
Contributor Author

mpylon commented Jul 17, 2024

@cla-avalonia agree

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0050508-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Copy link
Member

@grokys grokys left a comment

Choose a reason for hiding this comment

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

Sorry about the delay on reviewing this, LGTM!

@grokys grokys added this pull request to the merge queue Aug 30, 2024
Merged via the queue into AvaloniaUI:master with commit 82d6408 Aug 30, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VirtualizingStackPanel scrolls more than expected when receiving a Reset event.
5 participants