You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[drag-drop] Re-entering the initial container can place the dragged item in an undesirable index #18697
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.
Like this:
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);
Activity
[-][drag-drop] Re-entering the initial container can place an item in an undesirable index[/-]fix(drag-drop): only return item to initial index if the new containe…
fix(drag-drop): only return item to initial index if the new containe…
fix(drag-drop): only return item to initial index if the new containe…
angular-automatic-lock-bot commentedon Apr 12, 2020
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.