Skip to content

Commit 3a8fb56

Browse files
committed
fix(cdk/drag-drop): Support for nested drop containers
Fixes a two issues: - The first fixed issue is that the elements of cdkDropListConnectedTo previously had to be ordered correctly to support moving items into an inner drop container. Sepcifically, inner drop containers had to be listed before their outer ancestors. - The second fixed issue is that items of an inner container could not be re-ordered without moving the item out of the container and then back in. Fixes #16671
1 parent b4a89d5 commit 3a8fb56

4 files changed

Lines changed: 692 additions & 217 deletions

File tree

src/cdk/drag-drop/directives/drop-list.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,10 @@ export class CdkDropList<T = any> implements OnDestroy {
363363

364364
/** Handles events from the underlying DropListRef. */
365365
private _handleEvents(ref: DropListRef<CdkDropList>) {
366+
merge(ref.receivingStarted, ref.receivingStopped)
367+
.pipe(takeUntil(this._destroyed))
368+
.subscribe(() => this._changeDetectorRef.markForCheck());
369+
366370
ref.beforeStarted.subscribe(() => {
367371
this._syncItemsWithRef(this.getSortedItems().map(item => item._dragRef));
368372
this._changeDetectorRef.markForCheck();

0 commit comments

Comments
 (0)