Skip to content

When dragging to scroll, spurious drag velocity is applied #5174

@valadaptive

Description

@valadaptive

Describe the bug
When dragging to scroll in a ScrollArea, egui applies the drag velocity if the user releases their finger/mouse button mid-drag. However, this velocity is only updated when a drag actually takes place. If the cursor decelerates quickly, no drag events will be registered because it's not moving, and the velocity of the previous drag event will be used:

firefox_TBCANyJ9qf.mp4

To Reproduce
Steps to reproduce the behavior:

  1. Open the egui demo app
  2. Open a demo that lets you drag to scroll, e.g. the "Scroll a lot of lines" tab in the "Scrolling" demo, the "Misc Demos" window, or the "EasyMark Editor".
  3. Drag a scrollable area quickly, then decelerate your dragging movement rapidly.
  4. Release the mouse button and observe that the previous velocity is kept even if the cursor is currently not moving.

Expected behavior
No further scrolling should occur, as the cursor is completely still and hence has no velocity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions