Closed
Description
Reproduction
Steps to reproduce:
- Go to https://stackblitz.com/edit/components-issue-damkoo
- Try to use the DragHandle to move a row up or down
Expected Behavior
What behavior were you expecting to see?
I would expect the drag & drop to work and not produce an exception even when used within an OnPush setup.
Actual Behavior
What behavior did you actually see?
The member initialContainer seems to be undefined at the point where the first drag operation is started.
components/src/cdk/drag-drop/drag-ref.ts
Line 816 in 847a469
The strange thing is once change detection is triggered due to any other action the error goes away.
This can be reproduced by clicking the button before doing the first drag operation.
NOTE: That the AppComponent needs to have ChangeDetectionStrategy set to OnPush to reproduce this issue.
Environment
- Angular: 8.2.14
- CDK/Material: 8.2.3
- Browser(s): Chrome 79, Firefox 71
- Operating System (e.g. Windows, macOS, Ubuntu): macOS