motiondivision / motiondivision/motion
[BUG] Drag inertia decelerates abruptly after a fast flick on a touch device.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 33.7k
- Forks
- 1.4k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 14
Description
On a touch device, when dragging an element by means of a ‘short fast swipe’* the inertia animation will abruptly decelerate and then slowly finish animating to a stand still.
The same type of flick while inertia is still being animated will result in the desired/expected/natural inertia speed.
*Like a flick. So when you swiftly throw up the draggable element with you thumb like you would scroll down a webpage. This happens consistently with the way I naturally use my device.
CodeSandbox reproduction of the bug
https://codesandbox.io/s/nervous-kate-bju9ik?file=/src/App.js
Steps to reproduce
- Visit the sandbox output on a mobile browser: https://bju9ik.csb.app/
- Throw a fast thumb flick up to trigger the drag and inertia animation
- Notice how from a standstill it’ll decelerate
- Notice how from still animating inertia it’ll animate the newly triggered inertia like it should
Expected behavior
Animate fast flick inertia from standstill without first decelerating
Video or screenshots
https://user-images.githubusercontent.com/1086519/199209026-b62e0bee-05e2-420d-b637-1d3851139ee8.mov
Environment details
Device: iPhone 13 running either iOS 15 or 16 / Oppo A15 running Android 10
Browser: Safari, Google Chrome, Firefox and webview inside a native app
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the linked CodeSandbox reproduction on a mobile browser and inspect the drag and inertia implementation in the repository. Trace the path for a fast flick from a standstill versus a flick during existing inertia. Done means a fast standstill flick starts at the expected inertia speed without abrupt deceleration, while existing inertia behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100