bug(cdkDropList): Wrong index for cdkPlaceHolder/cdkDrag after drag/hover other list and going back to original droplist
Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
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:
- Pick up an item from the most right list
- Drag(not drop) it over a list to the left
- Return to the original list
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
- Angular:
- CDK/Material:
- Browser(s):
- Operating System (e.g. Windows, macOS, Ubuntu):
If this i not an issue, please elaborate how i can replicate what happens when dragging an item over a right list. For example, when using the middle list, you can mess up the placeholder by going to the left, but if you drag it over the right container, the drag placeholder is back to its original index.
I think i can then maybe correct the index using the DragEnter of the Droplist, however i can't figure it out.
I don't know if bumping this is a good idea, but i recently (almost) finished this learning project and would like to add the URL to the application itself: testsolitaire
Thank you in advance for your time if you could offer some insights.