Repository navigation
Conversation
The modulo that removes the hidden item offset turned a negative page position into a value close to that offset, so the touch position of the dragged item was off by 9999 when its handle was partly scrolled off the left edge.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Only Paper moves a hidden item out of the viewport, so a visible handle further than half of that offset to the right (a very wide web viewport) must not be treated as hidden.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
With
customHandle, the offset of the handle is measured when a drag starts. The measuredpageXwas passed through(x + 9999) % 9999to remove the off-screen offset of hidden items, which turns a negativepageXinto a value close to 9999.So when the handle of the dragged item was partly off the left edge of the screen (an item partly scrolled out of a horizontal ScrollView), the touch position was off by 9999: horizontal auto scroll jumped to the end of the list and the reorder trigger position was wrong.
The off-screen offset is now removed only on the old architecture, the only place where a hidden item is moved off the screen, and only from positions that contain it.
Testing
New jest tests with a mocked
measure(the negative position case fails on main: expected -50, received 9949; the others guard the positions that already worked, including a handle far to the right on a very wide web viewport).before-tests-on-main.txtafter-tests-with-fix.txt