Skip to content

fix: Auto scroll not moving at low speeds - #653

Draft
MatiPl01 wants to merge 2 commits into
mainfrom
fix/auto-scroll-slow-speeds
Draft

MatiPl01 wants to merge 2 commits into
mainfrom
fix/auto-scroll-slow-speeds

Conversation

@MatiPl01

@MatiPl01 MatiPl01 commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Description

Auto scroll steps smaller than 1px were dropped, so speeds below about 60px/s at 60Hz (120px/s at 120Hz) never scrolled and the outer part of the activation area did nothing.

The steps now add up in the target offset. The native scroll call is still skipped until the target is at least 1px away from the current offset.

Also removes two delays in the same code, which the slow speeds made noticeable:

  • while the item is held at a content end, the target offset goes past what the scrollable can reach. After a change of direction nothing scrolled until the target came back (about 50px divided by the speed, so up to a second). The next step now starts from the real offset in that case,
  • the time spent outside of the activation area counted as elapsed time, so the first step after returning to it was up to 100ms worth of scrolling. With an autoScrollInterval (300ms by default on Android with the New Architecture) the first step after returning now waits one interval, the same as the very first one, instead of jumping right away.

Testing

New jest tests, all fail on main. The scroll speeds are unchanged (992 / 198.4 / 49.6px in 1s at 1000 / 200 / 50px/s before and after).

Evidence
Tests on main before-test-on-main.txt
Tests with the fix after-test-with-fix.txt

@MatiPl01 MatiPl01 self-assigned this Nov 25, 2026
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
react-native-sortables-docs Ignored Ignored Preview Nov 26, 2026 1:54pm UTC

- the target offset can go past what the scrollable reaches, so after a change of direction nothing scrolled until the target came back. The next step now starts from the real offset in that case
- the time spent outside of the activation zone counted as elapsed time, so the first step after returning to the zone was up to 100 ms worth of scrolling

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant