diff --git a/src/cdk/drag-drop/directives/drag.spec.ts b/src/cdk/drag-drop/directives/drag.spec.ts index dad75c66f14f..b9a88c6a0ece 100644 --- a/src/cdk/drag-drop/directives/drag.spec.ts +++ b/src/cdk/drag-drop/directives/drag.spec.ts @@ -892,6 +892,25 @@ describe('CdkDrag', () => { expect(fixture.componentInstance.dropInstance.data).toBe(fixture.componentInstance.items); }); + it('should sync the drop list inputs with the drop list ref', () => { + const fixture = createComponent(DraggableInDropZone); + fixture.detectChanges(); + + const dropInstance = fixture.componentInstance.dropInstance; + const dropListRef = dropInstance._dropListRef; + + expect(dropListRef.lockAxis).toBeFalsy(); + expect(dropListRef.disabled).toBe(false); + + dropInstance.lockAxis = 'x'; + dropInstance.disabled = true; + + dropListRef.beforeStarted.next(); + + expect(dropListRef.lockAxis).toBe('x'); + expect(dropListRef.disabled).toBe(true); + }); + it('should be able to attach data to a drag item', () => { const fixture = createComponent(DraggableInDropZone); fixture.detectChanges(); diff --git a/src/cdk/drag-drop/directives/drop-list.ts b/src/cdk/drag-drop/directives/drop-list.ts index b0ba959a3d13..439c494ae9c9 100644 --- a/src/cdk/drag-drop/directives/drop-list.ts +++ b/src/cdk/drag-drop/directives/drop-list.ts @@ -315,6 +315,7 @@ export class CdkDropList implements CdkDropListContainer, AfterContentI }); } + ref.disabled = this.disabled; ref.lockAxis = this.lockAxis; ref.sortingDisabled = this.sortingDisabled; ref