Repository navigation
Conversation
…ng drags onDragStart is called after a delay, so a drag that ended before it was delivered called onDragEnd first and onDragStart afterwards with fromIndex -1. The start callback is now delivered before the end one in that case. The timeout that finishes a drop also marked the active item as dropped and reset the layer when another item had already been picked up. The drag state object was shared between all sortables on web, where shared values keep the object they are given.
|
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
Edge cases in the drag state handling for very short and overlapping drags:
onDragStartis called after a short delay. When the drag ended before it was delivered (the finger lifted within about two frames of the activation),onDragEndwas called first andonDragStartafterwards withfromIndex: -1. An app that sets a flag inonDragStartand clears it inonDragEndended up with the flag stuck. The start callback is now delivered right before the end one in that case, with the order from the drag start.onActiveItemDroppedis still called for every item.Testing
Six new jest tests, four fail on main (the first one receives
endbeforestartwithfromIndex: -1). The other two guard what this change adds: a singleonDragStartcall for a regular drag, and the drag state not being shared by two sortables. Regular drags checked on the iOS simulator (Fabric).before-tests-on-main.txtafter-tests-with-fix.txt