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

Improve Scrollbar drag behavior #112434

Merged
merged 1 commit into from Oct 24, 2022
Merged

Conversation

xu-baolin
Copy link
Member

@xu-baolin xu-baolin commented Sep 27, 2022

This change lets the thumb always follow the pointer even if the scroll extent changed when dragging the thumb.

Fixes #112072
Fixes #107765

@flutter-dashboard flutter-dashboard bot added f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. labels Sep 27, 2022
@xu-baolin xu-baolin requested a review from Piinks Sep 27, 2022
@TahaTesser
Copy link
Member

TahaTesser commented Sep 27, 2022

This also fixes #107765, my fix for it was reverted.

Since this seems to be a better fix, I'm assigning #107765 to you.

@@ -1446,15 +1457,15 @@ class RawScrollbar extends StatefulWidget {
/// Provides defaults gestures for dragging the scrollbar thumb and tapping on the
/// scrollbar track.
class RawScrollbarState<T extends RawScrollbar> extends State<T> with TickerProviderStateMixin<T> {
Offset? _dragScrollbarAxisOffset;
Offset? _startDragScrollbarAxisOffset;
Copy link
Member Author

@xu-baolin xu-baolin Sep 27, 2022

Choose a reason for hiding this comment

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

@TahaTesser Thanks for the sync info, I tested it and it did fix the issue by accident. : )

Copy link
Member Author

@xu-baolin xu-baolin Oct 24, 2022

Choose a reason for hiding this comment

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

@Piinks Hi, do you have a chance to take a look at this change? : )

Copy link
Contributor

@Piinks Piinks Oct 24, 2022

Choose a reason for hiding this comment

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

Ah yes, apologies! I was out of town and this got buried in my inbox. I checked it out before I left and forgot to click submit - sorry! 😓

Copy link
Contributor

@Piinks Piinks left a comment

Thanks for the PR @xu-baolin! I will check out a copy of this tomorrow and test it out! :)

@xu-baolin
Copy link
Member Author

xu-baolin commented Oct 4, 2022

Thanks for the PR @xu-baolin! I will check out a copy of this tomorrow and test it out! :)

Thank you, this maybe also help to implement the infinite scrollbar. You know that the infinite scrollable's scroll extent always changes.

Piinks
Piinks approved these changes Oct 24, 2022
Copy link
Contributor

@Piinks Piinks left a comment

LGTM-cat

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 24, 2022
@auto-submit auto-submit bot merged commit 6154b3b into flutter:master Oct 24, 2022
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
3 participants