Skip to content

Commit 02908ce

Browse files
authored
fix(cdk/drag-drop): remove boundary error (#23966)
When the boundaries were added to the `drag-drop` module, I assumed that users would always want the element to be contained inside the boundary, but it looks like there are some cases where that's not the case. These changes remove the error. Fixes #23767.
1 parent 738e514 commit 02908ce

File tree

1 file changed

+1
-10
lines changed
  • src/cdk/drag-drop/directives

1 file changed

+1
-10
lines changed

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

+1-10
Original file line numberDiff line numberDiff line change
@@ -370,16 +370,7 @@ export class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {
370370
return this.element.nativeElement.closest<HTMLElement>(boundary);
371371
}
372372

373-
const element = coerceElement(boundary);
374-
375-
if (
376-
(typeof ngDevMode === 'undefined' || ngDevMode) &&
377-
!element.contains(this.element.nativeElement)
378-
) {
379-
throw Error('Draggable element is not inside of the node passed into cdkDragBoundary.');
380-
}
381-
382-
return element;
373+
return coerceElement(boundary);
383374
}
384375

385376
/** Syncs the inputs of the CdkDrag with the options of the underlying DragRef. */

0 commit comments

Comments
 (0)