fix(drag-drop): update root element if selector changes (#14426)

Currently the root element is only resolved once on init, however since it's an input, it could change. These changes add some logic to keep the element up to date.
This commit is contained in:
Kristiyan Kostadinov
2018-12-19 16:05:53 +01:00
committed by Jeremy Elbourn
parent ecaec183de
commit 14b90db522
3 changed files with 48 additions and 15 deletions
+2 -1
View File
@@ -6,7 +6,7 @@ export declare const CDK_DROP_LIST: InjectionToken<CdkDropListContainer<any>>;
export declare const CDK_DROP_LIST_CONTAINER: InjectionToken<CdkDropListContainer<any>>;
export declare class CdkDrag<T = any> implements AfterViewInit, OnDestroy {
export declare class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {
_dragRef: DragRef<CdkDrag<T>>;
_handles: QueryList<CdkDragHandle>;
_placeholderTemplate: CdkDragPlaceholder;
@@ -31,6 +31,7 @@ export declare class CdkDrag<T = any> implements AfterViewInit, OnDestroy {
getPlaceholderElement(): HTMLElement;
getRootElement(): HTMLElement;
ngAfterViewInit(): void;
ngOnChanges(changes: SimpleChanges): void;
ngOnDestroy(): void;
reset(): void;
}