Skip to content

Commit e2de5e6

Browse files
crisbetommalerba
authored andcommitted
fix(drag-drop): coerce drop list autoScrollDisabled input (#17480)
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 #17475.
1 parent f0df308 commit e2de5e6

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,7 @@ export class CdkDropList<T = any> implements AfterContentInit, OnDestroy {
106106

107107
/** Whether sorting within this drop list is disabled. */
108108
@Input('cdkDropListSortingDisabled')
109-
get sortingDisabled(): boolean { return this._sortingDisabled; }
110-
set sortingDisabled(value: boolean) {
111-
this._sortingDisabled = coerceBooleanProperty(value);
112-
}
113-
private _sortingDisabled = false;
109+
sortingDisabled: boolean = false;
114110

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

277273
ref.disabled = this.disabled;
278274
ref.lockAxis = this.lockAxis;
279-
ref.sortingDisabled = this.sortingDisabled;
280-
ref.autoScrollDisabled = this.autoScrollDisabled;
275+
ref.sortingDisabled = coerceBooleanProperty(this.sortingDisabled);
276+
ref.autoScrollDisabled = coerceBooleanProperty(this.autoScrollDisabled);
281277
ref
282278
.connectedTo(siblings.filter(drop => drop && drop !== this).map(list => list._dropListRef))
283279
.withOrientation(this.orientation);

0 commit comments

Comments
 (0)