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
Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When using cdkDropList, dragging causes the order to become misaligned and incorrect.
I have included a link to a stackblitz which demonstrates the problem and I have uploaded a video below showcasing the same problem.
20250320-1841-32.7959590.mp4
Additional Information
Removing the transition: transform css had no effect.
Removing the fx-flex class has no effect.
Removing the fx-align-start-center class has no effect.
Removing the fx-row class reduces the severity of the problem, but does not eliminate it.
Increasing the height of the draggable elements reduces the chance of the undesirable effect triggering, but does not eliminate it.
Suggested Fix
Use CdkDropList._cachePositions() before performing reorder operations (Like on the cdkDragStarted event). Alternatively, you could use _cachePositions() when any element's height/width changes, but that would likely be much less performant.
thavus
changed the title
bug(CDK - Drop List): Drag order misaligned and incorrect.
bug(cdkDropList): Drag order misaligned and incorrect.
Mar 20, 2025
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When using cdkDropList, dragging causes the order to become misaligned and incorrect.
I have included a link to a stackblitz which demonstrates the problem and I have uploaded a video below showcasing the same problem.
20250320-1841-32.7959590.mp4
Additional Information
transition: transform
css had no effect.fx-flex
class has no effect.fx-align-start-center
class has no effect.fx-row
class reduces the severity of the problem, but does not eliminate it.Suggested Fix
Use
CdkDropList._cachePositions()
before performing reorder operations (Like on the cdkDragStarted event). Alternatively, you could use_cachePositions()
when any element's height/width changes, but that would likely be much less performant.Reproduction
StackBlitz link:
https://stackblitz.com/edit/components-issue-starter-y53wrlvc?file=src%2Fglobal_styles.css
Steps to reproduce:
Expected Behavior
The order should not be misaligned and incorrect.
Actual Behavior
While dragging, the elements overlay on top of one another and become misaligned. The order also becomes incorrect.
Environment
The text was updated successfully, but these errors were encountered: