Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
- 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 - the check for the line above includes the gap and lets an item wider than the container start a line, as the layout does
…ed lines" With fixed items the order could flip back and forth with the pointer at rest, and with gaps an item could end two lines away from the pointer. This reverts commit 7809b68.
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
Fixes several cases in which the
Sortable.Flexsort strategy and the layout disagreed about where items wrap, which made the dragged item jump to a wrong place, the order flip back and forth with the finger at rest, or, with a fixed-order item at the end, the order itself break:fixed-orderlast item the target went past the end of the list, the fixed item was overwritten and another key was duplicated (onDragEndthen returned an order with a hole),One commit per case. They are in one PR because each of them alone leaves the others visible in the same drags (and they touch the same few lines).
Known limitation: an item dragged to a line that ends with a
fixed-orderitem is not moved while the pointer is over or past that fixed item (it has to be dropped before it). On main some of these drags moved the item, by accident of the size check removed here, and others broke the order.Testing
9 new jest tests, 7 fail on main (the other two pin the rule that the first item of a line never wraps). Randomized drags through the real component and strategy: no broken order, no flipping and no out of range target on this branch (numbers for main in the file below).
before-test-on-main.txtafter-test-with-fix.txtfuzz-results.txt