bug:(@angular/cdk/drag-drop): Cannot read property 'clientRect' of undefined
See original GitHub issueBug, feature request, or proposal:
BUG: when drag-dropping an item between two connected dropzone, an error occurs randomly
See video and image below
What is the expected behavior?
No error should occur.
What is the current behavior?
An error occurs randomly as soon as an item enters in the dropzone. The (dropped) event happens anyway.
What are the steps to reproduce?
Classic connected dropzones.
My dropzones are not in the same component.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
“@angular/cdk”: “^7.0.0-beta.0” “@angular/material”: “^6.4.7” “@angular/core”: “^6.1.6”,
Is there anything else we should know?
The error is located in drag-drop.es5.js.CdkDrop._sortItem (drag-drop.es5.js:1436)
var currentPosition = siblings[currentIndex].clientRect;
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:28 (4 by maintainers)
Top Results From Across the Web
cdkDropListData drag-drop Angular Material - Stack Overflow
Here I'm getting the error "Cannot read property 'routePoints' of undefined" when dragging item from a list to another
Read more >Cannot read property 'get' of undefined : r/node - Reddit
This means the client object does not have a property called commands. So client.commands result in undefined (which does not throw an error)....
Read more >Is there a way to resize using angular material drag and drop ...
import { CdkDragMove } from '@angular/cdk/drag-drop'; ... Cannot read property 'subscribe' of undefined after running npm test (Angular 2 unit testing) ...
Read more >@angular/material: Versions | Openbase
select: value set through property not being propagated to value accessor (#10246) ... bug fix, schematics: external stylesheets cannot be migrated ...
Read more >ANGULAR 13 TypeError Cannot read property of undefined
In this tutorial, we will see a most common error faced by the Angular developers named as "TypeError Cannot read property of undefined...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the reproduction @kanidjar. It looks like the issue was fixed in master already.
@crisbeto I am trying to sort or dragdrop dynamically generated components. The container has the cdkDropList directive while the dynamically components has the cdkDrag directive and I would expect it works, It is simply not working.
[Parent Component that holds a container for the dynamic child component to insert.]
[HTML of the child component that would be inserted in the container.]