Skip to content

If I stop mouse movement suddenly and release button, the page sometimes starts moving #82

@nyanpasu64

Description

@nyanpasu64

Describe the bug
If I scroll a page, suddenly stop the mouse, and then release the mouse button while the mouse is nonmoving, the page sometimes starts moving.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Go to https://patorjk.com/misc/scrollingtext/timewaster.php
  2. In scrollbar or smartphone mode, drag the page with the left or right button.
  3. Stop the mouse abruptly.
  4. Release the button.

Expected behavior
The page does not move.

Device info:

  • operating system: Fedora 42
  • Browser and version: Firefox 142.0.1 (64-bit)
  • addon version: 9.2

Additional info
I think the problem is when you initiate momentum scroll when I release my mouse button, you take the velocity computed from the distance between the last 2-ish mouse cursor updates divided by the time difference. This breaks when the mouse doesn't move at all before releasing it, but it was last moving at high speed.

If the mouse is released after the last mouse movement update, you should instead use the distance between the last mouse movement and the position of the release to compute momentum scrolling.

Question: How long between a position update and a button release, before we treat it as nonmoving?

  • At all?
  • More than 10ms? 100ms?
  • More than 2x the polling rate?
    • But you don't know the polling rate, and just because the user moves the mouse every 500ms you shouldn't treat a mouse release as a momentum scroll because it happens 400ms after moving the mouse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions