-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Description
Reproduction
"Drag&Drop connected sorting group" example from the official examples page.
Behavior
Regarding the following code line:
this._dropContainer.enter(this, x, y,
// If we're re-entering the initial container,
// put item the into its starting index to begin with.
newContainer === this._initialContainer ? this._initialIndex : undefined);
Like the comment states, re-entering the initial container will place the item back in its initial position. Checks to perform a sort occur after this code line.
This has the potential to cause undesirable behavior when a container is re-entered at a location not near the initial index AND when no sorting occurs.
Now, I assume this behavior was coded this way to better handle when sorting is disabled, because it makes more sense that the item shouldn't be sorted away from its initial index. But when sorting is enabled (like in the gif above) and those stated conditions are met, the item doesn't get placed into the expected index.
Can the following change be made (checking for sortingDisabled
)?
this._dropContainer.enter(this, x, y,
// If we're re-entering the initial container,
// put item the into its starting index to begin with.
newContainer === this._initialContainer && newContainer.sortingDisabled ? this._initialIndex : undefined);