Description
Bug, feature request, or proposal:
Bug
What is the expected behavior?
When reordering items, they should reorder correctly
What is the current behavior?
Some edge cases will cause incorrect rendering of items in the DOM. The data inside the cdk-container is correct though.
What are the steps to reproduce?
StackBlitz example: https://stackblitz.com/edit/angular-e4nuja?file=app%2Fautocomplete-overview-example.html
- Drag the last item to the first position, this will cause the first item to become the second (correct - 0,1,2,3 order).
- Drag the now second item (that was first) to the last position, this will cause an order of 1,2,0,3.
As a note: after doing the steps above, adding a console.log, and dragging the third item to the first (where it should be) will show the previousIndex and currentIndex as the same value - 0.
What is the use-case or motivation for changing an existing behavior?
Can't seem to always show correct order - in one edge cases where dragging last to first and second to last.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Latest as of time of writing.
Material = 6.4.1
Cdk = 6.4.1
CdkExperimental = 6.4.1
Is there anything else we should know?
This seems to be the only edge case I've been able to find, even with help from our internal testers.