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
{{ message }}
Repository navigation
bug:(@angular/cdk/drag-drop): Cannot read property 'clientRect' of undefined #13077
It's hard to tell what's going on based on the video. Based on the stack trace, it looks like a CdkDrag somehow ended up in the wrong container, but I can't think of any obvious place where it could happen. @kanidjar would you be able to put together a simplified example that breaks?
I'm getting this error when applying [cdkDropList] directive it the parent component and [cdkDragData] in it's childrens. When everything in the one component, then no errors.
I'm getting this error when applying [cdkDropList] directive it the parent component and [cdkDragData] in it's childrens. When everything in the one component, then no errors.
Yes, I am facing the same, is there a solution for this?
@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.]
The drag & drop is a great feature, In my opinion it should be not only with simple list that we can drag and drop but also components and more specific to dynamic components. I am sure the usage of dynamic components may be limited scope but this is where Angular is helping new developers like us achive a lot of things quickly and easily. I do not understand the priority of the bugs but to me this bug should be raised to a higher priority. @crisbeto please comment.
I reproduce it adding D&D to move reactive form controls (siblings dynamically added to a single form within a single angular component). @JesseZomer or @cantastage could you please elaborate on the workaround you've found?
I am experiencing the same issued. I need to be able to call the (cdkDragDropped) event within the child component, but this error makes it so the cdkDropList does not recognize the cdkDrop when in separate components.
Activity
kanidjar commentedon Sep 13, 2018
FYI: the error occurs when adding the 2nd "List" item.
crisbeto commentedon Sep 15, 2018
It's hard to tell what's going on based on the video. Based on the stack trace, it looks like a
CdkDragsomehow ended up in the wrong container, but I can't think of any obvious place where it could happen. @kanidjar would you be able to put together a simplified example that breaks?kanidjar commentedon Sep 15, 2018
@crisbeto
here it is : https://stackblitz.com/edit/angular-uhe5x7
Try to drop a same item twice in the red zone.
crisbeto commentedon Sep 16, 2018
Thanks for the reproduction @kanidjar. It looks like the issue was fixed in master already.
kanidjar commentedon Sep 16, 2018
Nice, thank you @crisbeto
dakotamaker commentedon Oct 12, 2018
@crisbeto what was the fix exactly? I'm still seeing this issue and I am on the newest version of the cdk
crisbeto commentedon Oct 12, 2018
@dakotamaker it's been a while so I don't remember. I think I tried out the Stackblitz against master and the issue just wasn't there.
jurStv commentedon Oct 22, 2018
I'm facing same issue. Did you find any way to resolve this one @kanidjar?
antonpegov commentedon Nov 4, 2018
I'm getting this error when applying [cdkDropList] directive it the parent component and [cdkDragData] in it's childrens. When everything in the one component, then no errors.
birjitningomba commentedon Nov 13, 2018
Yes, I am facing the same, is there a solution for this?
birjitningomba commentedon Nov 17, 2018
@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.]
birjitningomba commentedon Nov 20, 2018
The drag & drop is a great feature, In my opinion it should be not only with simple list that we can drag and drop but also components and more specific to dynamic components. I am sure the usage of dynamic components may be limited scope but this is where Angular is helping new developers like us achive a lot of things quickly and easily. I do not understand the priority of the bugs but to me this bug should be raised to a higher priority. @crisbeto please comment.
5 remaining items
davidecavestro commentedon Jan 9, 2019
I reproduce it adding D&D to move reactive form controls (siblings dynamically added to a single form within a single angular component).
@JesseZomer or @cantastage could you please elaborate on the workaround you've found?
jheyl commentedon Jan 16, 2019
Hey,
I stumbled upon this thread because I have the exact same the Problem when I use the cdkDrag Directive on a span inside a ngb-panel.
Using the exact same code inside a
<ul>-element without the ngb-container works without any problems.amumm commentedon Jan 24, 2019
I am experiencing the same issued. I need to be able to call the (cdkDragDropped) event within the child component, but this error makes it so the cdkDropList does not recognize the cdkDrop when in separate components.
waniashik commentedon Jan 29, 2019
I am struggling with the same issue, has this issue been fixed?
zhaodong-wang commentedon Feb 17, 2019
FYI, it seems that I added
opacity: 1to the draggable items and the error disappears. Not sure why.andyrue commentedon Feb 28, 2019
I added a cdkDragHandle to an element inside my draggable component and I no longer got this error.
xdevnull commentedon Mar 18, 2019
Any fix?
ibenjelloun commentedon May 21, 2019
I'm reproducing this error on the stackblitz example from angular.io :
https://stackblitz.com/angular/dgxqejknvgg?file=app%2Fcdk-drag-drop-sorting-example.ts
fix(drag-drop): error if drag sequence is started while another one i…
fix(drag-drop): error if drag sequence is started while another one i…
AlyRadwan2020 commentedon Jul 13, 2019
kflo commentedon Aug 17, 2019
bump ...
angular-automatic-lock-bot commentedon Sep 17, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.