bug(cdkDropList): Wrong index for cdkPlaceHolder/cdkDrag after drag/hover other list and going back to original droplist #28919
Labels
area: cdk/drag-drop
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Is this a regression?
The previous version in which this bug was not present was
No response
Description
My apologies if this is a stupid use case, I am trying to use multiple droplists as a base for a patience/solitaire card game as a learning project. There are multiple connected droplists where you can only drag the last item, and drop it in the last position of another container. This works amazing.
However, dragging from a cdkDroplist from the right to another cdkDroplist to the left of it and returning to the original list does not put the cdkPlaceHolder in the original index. Dragging from left to right (and returning to the original list) does?!
Not sure is this is an issue or working as intended.
I think i understand partially why it happens, but don't understand why it does work from left to right.
Reproduction
StackBlitz link: https://stackblitz.com/~/github.com/PsychoSpike/cdkDropListsSortedToBottom
Steps to reproduce:
Expected Behavior
The CdkDragPlaceholder and CdkDrag element returns to its original index
Actual Behavior
The CdkDragPlaceholder shows up at the wrong index and the CdkDrag element gets put into index-1 from starting the drag
Environment
The text was updated successfully, but these errors were encountered: