Repository navigation
Conversation
- an item whose walk along a line ended on a fixed item was not moved at all, it now takes the closest free slot - an item could not move to the last line when only fixed items followed its slot there - the place of the active item in its line is read from the layout, which can have one line less than expected once the item is taken out - an item wider than the container can be moved to a previous line, where it starts a line as in the layout
The expected line is one too far when the item that takes the place of the dragged one joins the previous line. The bounds of the next move were then taken from a line that does not exist, and the order could flip back and forth with the pointer at rest.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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
Follow-up to #655 (stacked on it): drags in
Sortable.Flexthat left the dragged item where it was although there was a valid place for it under the pointer:fixed-orderitem was not moved at all, so it could not be dragged to a line that ends with a fixed item while the pointer was over or past that item, or when only fixed items followed its slot there. It now takes the closest free slot,Known limitation: with gaps, an item can only be moved one line up through the start of the list when the line above has room for it without the gap (two order changes instead of one, same as on main).
Testing
13 jest tests in
index.test.tsx, 9 fail on the base branch. Randomized drags, the same inputs on this branch, its base and main: no flipping at rest and no broken order on this branch, and the dragged item ends closer to the pointer than on the base in 4 to 5.5% of the drags and farther in 0.01 to 0.08%.Not checked on a device.
before-test-on-base-branch.txtafter-test-with-fix.txtfuzz-results.txt