Skip to content

Conversation

@Piinks
Copy link
Contributor

@Piinks Piinks commented Dec 1, 2023

WIP
Loosely based on the chromium smooth scroller for animating stepped mouse wheel scrolling.

Fixes #32120

The original PR (#115314) could not move forward until we could reliably distinguish trackpad input from mouse wheels on web. This was needed because trackpads already curve input deltas for smooth scrolling. If this curve is applied to already curved input, the user's scrolling input would go no where. A heuristic was added a while ago to identify trackpads on web, and it seems to be working well so let's see if we can get this in. :)

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@Piinks Piinks added framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. labels Dec 1, 2023
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@github-actions github-actions bot added the a: text input Entering text in a text field or keyboard related problems label Dec 1, 2023
@Piinks Piinks added a: desktop Running on desktop a: mouse Issues related to using a mouse or mouse support labels Dec 5, 2023
@loic-sharma
Copy link
Member

loic-sharma commented Dec 5, 2023

Here's Windows - mouse wheel, scrolling works but appears to not respect my system's scroll speed settings if animatePointerScroll is true:

pr_139392_windows_desktop_physical_scroll_wheel

@loic-sharma
Copy link
Member

Here's Windows web - trackpad, scrolling works but it is slow and appears to ignore scroll events sporadically if animatePointerScroll is true. Here's me attempting to scroll to the ends of the list as quickly as possible:

Windows web - trackpad

@Piinks
Copy link
Contributor Author

Piinks commented Dec 6, 2023

Ah ok, thank you @loic-sharma this is very helpful. Trackpads on web should not be going through the animated pointer path. This is why we were unable to land this change previously because it caused sporadic results with trackpad on web. It looks like we need to better identify trackpads on web so that they do not go through this code path.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@text-exemption-reviewers" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@Piinks
Copy link
Contributor Author

Piinks commented Dec 12, 2023

Thanks again to @loic-sharma. I filed #139990 to follow up on the issue with identifying trackpads on web. I also updated #32120 to reflect the latest info on the bug, along with some work arounds and packages I found that achieve the desired effect. Until we resolve the web issue, I do not think we can land this as it causes erratic scrolling with trackpads on web, which is definitely not an improvement. 🙃

@Piinks Piinks closed this Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop a: mouse Issues related to using a mouse or mouse support a: text input Entering text in a text field or keyboard related problems f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to smoothly animate stepped mouse scroll deltas

2 participants