-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Desktop edge scrolling #93170
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
Desktop edge scrolling #93170
Conversation
b47b649 to
e309a02
Compare
|
@mdebbar Is this old TODO of yours actually fixed? flutter/packages/flutter/lib/src/widgets/text_selection.dart Lines 1530 to 1531 in 2a00eac
I ran into a strange problem where vertical mouse dragging wasn't being detected properly in a test. I'm wondering if there's anything unimplemented there that could be causing it, or if that TODO should be removed. |
|
@justinmc if you look at that code, it's only using a |
|
Sounds good, thanks for the info. I'll make a quick attempt at using PanGestureRecognizer and see if that fixes the strange missing vertical drag component that I saw in the test. If it seems complicated, I'll save it for another PR. |
0515541 to
904d164
Compare
aeb96e8 to
ccad131
Compare
| DragStartDetails? _lastDragStartDetails; | ||
| DragUpdateDetails? _lastDragUpdateDetails; | ||
| Timer? _dragUpdateThrottleTimer; | ||
| bool _isMouseDragging = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HorizontalDragGestureRecognizer allows you to specify the type of pointer to accept, but now that we've switched to PanGestureRecognizer, which doesn't support that, we have to manually make sure we only listen to mouse drags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to add that to the existing PanGestureRecognizer or use a private subclass of PanGestureRecognizer here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea, looks like it's actually only a 2 line change to add it to PanGesureRecognizer because the super class already supports it.
|
@mdebbar Switching to PanGestureRecognizer worked without too much tweaking, and it fixed my test! I've replaced it here in this PR and removed your TODO. |
| switch (defaultTargetPlatform) { | ||
| case TargetPlatform.iOS: | ||
| case TargetPlatform.macOS: | ||
| if (cause == SelectionChangedCause.longPress |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious what does a long-press do on iOS and macOS? Is it the force press floating cursor that makes them different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup this handles the thing where you force press and then drag the cursor.
| PointerDeviceKind? kind, | ||
| }) : super( | ||
| debugOwner: debugOwner, | ||
| kind: kind, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kind is deprecated I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I missed that, thanks. I'll do the same thing but with supportedDevices as the deprecation message suggests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This should also close #28676 (the TODO issue) right?
|
@LongCatIsLooong That one is already closed, but I guess the TODO was missed. |
|
Adding the cherry pick tag after discussing with @mariamhas, if we're still doing cherry picks for 2.8. Shouldn't be a high risk of regressions. |
|
@justinmc and @HansMuller - when was this regression introduced? What's the impact if we don't take it for this hotfix? We should carefully weigh taking it now (the week right before the release) w/ delaying until a batch of fixes after the release. |
|
I'm ok with skipping this. The behavior without it is fairly bad, but it's actually not a regression. Also there were previously a few goldens issues with this. Probably best to let it be released normally if @mariamhas is alright with that. |
|
Leaving it out is fine with me, I understand the concern of this being
hotfixed so close to the release date.
…On Tue, Nov 30, 2021 at 12:52 PM Justin McCandless ***@***.***> wrote:
I'm ok with skipping this. The behavior without it is fairly bad, but it's
actually not a regression. Also there were previously a few goldens issues
with this. Probably best to let it be released normally if @mariamhas
<https://github.com/mariamhas> is alright with that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#93170 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANRXIQKGRH6DQRSBZDKTJSLUOU2QXANCNFSM5HO456BA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
When selection moves on desktop, the field will now scroll to view the scroll extent, like it already does on mobile.
TODO:
Fixes #32344
Fixes #59141