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

Deferred scrolling #13644

Merged
merged 2 commits into from
Nov 20, 2023
Merged

Conversation

TomEdwardsEnscape
Copy link
Contributor

This PR adds deferred scrolling, a feature of WPF. When enabled, dragging a scroll bar thumb won't affect the scrolling content until the pointer is released.

What is the current behavior?

It's not currently possible to prevent users from dragging a scroll thumb up and down the entire scrolled content area very quickly. This is easy to do and can have negative performance implications if a large amount of virtualised content is loaded.

How was the solution implemented (if it's not obvious)?

The solution is unfortunately intrusive, and requires changes to the low-level Track control. This is because Avalonia doesn't yet support Binding.UpdateSourceTrigger. If/when this is added, it will become possible to implement this feature purely within ScrollViewer by not writing binding values back to the source until the user releases the mouse button.

However, after discussions with @grokys it has been decided that we can proceed with the intrusive solution.

Breaking changes

None.

Obsoletions / Deprecations

None.

@MrJul
Copy link
Member

MrJul commented Nov 19, 2023

@TomEdwardsEnscape test ScrollViewerTests.Thumb_Does_Not_Become_Detached_From_Mouse_Position_When_Scrolling_Past_The_Start fails

@TomEdwardsEnscape TomEdwardsEnscape force-pushed the feature/deferred-scrolling branch from c77c9b1 to b524cc8 Compare November 19, 2023 13:16
@maxkatz6 maxkatz6 added this pull request to the merge queue Nov 20, 2023
Merged via the queue into AvaloniaUI:master with commit d62ff00 Nov 20, 2023
6 checks passed
@TomEdwardsEnscape TomEdwardsEnscape deleted the feature/deferred-scrolling branch November 20, 2023 07:38
@maxkatz6 maxkatz6 added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Nov 28, 2023
maxkatz6 pushed a commit that referenced this pull request Dec 5, 2023
* Implemented deferred scrolling

* Set IsDeferredScrollingEnabled in themes, where relevant
@maxkatz6 maxkatz6 added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Dec 5, 2023
@robloo robloo mentioned this pull request Jan 27, 2024
8 tasks
robloo added a commit to robloo/FluentAvalonia that referenced this pull request Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants