Skip to content

refactor(drag-drop): don't clone items array inside withItems #15103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/cdk/drag-drop/drop-list-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ export class DropListRef<T = any> {
private _previousSwap = {drag: null as DragRef | null, delta: 0};

/** Draggable items in the container. */
private _draggables: DragRef[];
private _draggables: ReadonlyArray<DragRef>;

/** Drop lists that are connected to the current one. */
private _siblings: DropListRef[] = [];
private _siblings: ReadonlyArray<DropListRef> = [];

/** Direction in which the list is oriented. */
private _orientation: 'horizontal' | 'vertical' = 'vertical';
Expand Down Expand Up @@ -256,7 +256,7 @@ export class DropListRef<T = any> {
* @param items Items that are a part of this list.
*/
withItems(items: DragRef[]): this {
this._draggables = items.slice();
this._draggables = items;
items.forEach(item => item._withDropContainer(this));
return this;
}
Expand Down