Skip to content

Commit 7e7e873

Browse files
crisbetojosephperrott
authored andcommitted
fix(drag-drop): ignore self inside connectedTo (#12626)
1 parent 38e5eb2 commit 7e7e873

File tree

1 file changed

+1
-3
lines changed
  • src/cdk-experimental/drag-drop

1 file changed

+1
-3
lines changed

src/cdk-experimental/drag-drop/drop.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,9 @@ export class CdkDrop<T = any> implements OnInit, OnDestroy {
291291
})
292292
.sort((a, b) => a.clientRect.top - b.clientRect.top);
293293

294-
// TODO(crisbeto): add filter here that ensures that the
295-
// current container isn't being passed to itself.
296294
this._positionCache.siblings = this.connectedTo
297295
.map(drop => typeof drop === 'string' ? this._dragDropRegistry.getDropContainer(drop)! : drop)
298-
.filter(Boolean)
296+
.filter(drop => drop && drop !== this)
299297
.map(drop => ({drop, clientRect: drop.element.nativeElement.getBoundingClientRect()}));
300298
}
301299

0 commit comments

Comments
 (0)