Skip to content

Commit

Permalink
fix(drag-drop): coerce drop list autoScrollDisabled input
Browse files Browse the repository at this point in the history
Coerces the `autoScrollDisabled` input to a boolean. Also removes the getter/setter from `sortingDisabled` since we can coerce it before passing it to the drag ref instead.

Fixes angular#17475.
  • Loading branch information
crisbeto committed Oct 23, 2019
1 parent 3052304 commit 075eb02
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/cdk/drag-drop/directives/drop-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,7 @@ export class CdkDropList<T = any> implements AfterContentInit, OnDestroy {

/** Whether sorting within this drop list is disabled. */
@Input('cdkDropListSortingDisabled')
get sortingDisabled(): boolean { return this._sortingDisabled; }
set sortingDisabled(value: boolean) {
this._sortingDisabled = coerceBooleanProperty(value);
}
private _sortingDisabled = false;
sortingDisabled: boolean = false;

/**
* Function that is used to determine whether an item
Expand Down Expand Up @@ -276,8 +272,8 @@ export class CdkDropList<T = any> implements AfterContentInit, OnDestroy {

ref.disabled = this.disabled;
ref.lockAxis = this.lockAxis;
ref.sortingDisabled = this.sortingDisabled;
ref.autoScrollDisabled = this.autoScrollDisabled;
ref.sortingDisabled = coerceBooleanProperty(this.sortingDisabled);
ref.autoScrollDisabled = coerceBooleanProperty(this.autoScrollDisabled);
ref
.connectedTo(siblings.filter(drop => drop && drop !== this).map(list => list._dropListRef))
.withOrientation(this.orientation);
Expand Down

0 comments on commit 075eb02

Please sign in to comment.