mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(drag-drop): ignore self inside connectedTo (#12626)
This commit is contained in:
committed by
Joey Perrott
parent
d251c79e63
commit
0a7750eb04
@@ -291,11 +291,9 @@ export class CdkDrop<T = any> implements OnInit, OnDestroy {
|
||||
})
|
||||
.sort((a, b) => a.clientRect.top - b.clientRect.top);
|
||||
|
||||
// TODO(crisbeto): add filter here that ensures that the
|
||||
// current container isn't being passed to itself.
|
||||
this._positionCache.siblings = this.connectedTo
|
||||
.map(drop => typeof drop === 'string' ? this._dragDropRegistry.getDropContainer(drop)! : drop)
|
||||
.filter(Boolean)
|
||||
.filter(drop => drop && drop !== this)
|
||||
.map(drop => ({drop, clientRect: drop.element.nativeElement.getBoundingClientRect()}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user