Fix Scrollbar can be dragged from above/below the main axis on desktop.#108166
Fix Scrollbar can be dragged from above/below the main axis on desktop.#108166TahaTesser wants to merge 1 commit intoflutter:masterfrom
Scrollbar can be dragged from above/below the main axis on desktop.#108166Conversation
| switch (position.axisDirection) { | ||
| case AxisDirection.up: | ||
| primaryDelta = _dragScrollbarAxisOffset!.dy - updatedOffset.dy; | ||
| primaryDelta = clampDouble(_dragScrollbarAxisOffset!.dy, 0, position.viewportDimension) - updatedOffset.dy; |
There was a problem hiding this comment.
I don't think clamping is the correct or expected behavior, especially in MacOS (haven't tested in Windows or Linux). As per the video below, which is Wikipedia open in Safari on MacOS Monoterey 12.4, looks like the last position where the mouse was "clicking" just before the scrollbar was about to overflow is saved and scrolling can resume only when the cursor crosses the that position.
Screen.Recording.2022-07-23.at.4.04.08.PM.mov
There was a problem hiding this comment.
Good catch, I will look into it.
There was a problem hiding this comment.
macOS with trackpad behaves differently
There was a problem hiding this comment.
looks same to me, mouse or touchpad. do you mind sharing a video?
There was a problem hiding this comment.
My colleague @huycozy tested this on all three platforms (Windows, macOS, and Linux) and concluded it's the same behavior on the other two platforms as @werainkhatri pointed out, thanks!
Based on these new findings, I will figure out the new scrolling scrollbar behavior.
|
Currently, updated offset and drag offset are not sufficient to distinguish drag from a specific location. |
fixes #107765
This PR fixes the issue where
Scrollbarcan be dragged above or below the viewport on the desktop.All the desktop platforms seem to have the same scroll behavior, (Scrollbar can only be dragged the dragging parallel to the cross axis).
#107765 has reproduced the issue Linux and Windows compared it with native applications and I have tested native macOS applications.
Bug
scrollbar_bug.mov
Fix
scrollbar_fixed.mov
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.