Frontmatter
| id | 8916 |
| title | Implement Kinetic/Momentum Scrolling in GridDragScroll |
| state | Closed |
| labels | enhancementdeveloper-experienceaiperformance |
| assignees | tobiu |
| createdAt | Jan 30, 2026, 2:25 PM |
| updatedAt | Jan 30, 2026, 2:55 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8916 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 30, 2026, 2:55 PM |
Implement Kinetic/Momentum Scrolling in GridDragScroll
tobiu assigned to @tobiu on Jan 30, 2026, 2:54 PM

tobiu
Jan 30, 2026, 2:55 PM
Input from Gemini 3 Pro:
✦ I have successfully implemented kinetic (momentum) scrolling in the
GridDragScrolladdon.Implementation Details
1. Kinetic Engine (
autoScroll):
- Decay Animation: Implemented a
requestAnimationFrameloop that continues scrolling after the user releases the drag.- Friction: Applies an exponential decay factor of
0.95per frame to simulate friction.- Threshold: The animation stops automatically when velocity drops below
0.1pixels/frame.2. Velocity Tracking:
- History Buffer:
onDragMovemaintains a rolling history of the last 10 drag events (timestamp and position).- Calculation:
onDragEndcalculates the release velocity based on the last 100ms of movement data, ensuring the "throw" feels responsive to the user's final gesture.3. UX Enhancements:
- Cursor Feedback: Sets
cursor: grabbing !importantondocument.bodyduring mouse drag operations to provide clear visual feedback.- Interruption: Any new
mousedownortouchstartevent instantly cancels an active kinetic animation, allowing the user to "catch" and stop the scroll.Outcome: The grid now supports smooth, physics-based scrolling on both desktop (mouse throw) and mobile (touch momentum), matching the native feel while running entirely on the Main Thread.
tobiu closed this issue on Jan 30, 2026, 2:55 PM
Problem: By consolidating touch scrolling into
GridDragScrolland usingpreventDefault()ontouchmoveevents, we have effectively disabled the browser's native momentum (inertial) scrolling. This results in a "dead" feel where the scroll stops instantly upon release, which is jarring for mobile users and sub-optimal for desktop "throw" interactions.Solution: Implement kinetic scrolling physics within the
Neo.main.addon.GridDragScrolladdon.Requirements:
onDragEnd, if the velocity exceeds a threshold, initiate arequestAnimationFrameloop that continues to scroll the grid.mousedownortouchstartinstantly stops any active kinetic animation.Benefits: