Skip to content

Commit ab40a9a

Browse files
committed
fix(tm): update draggable attr on hostUpdate
1 parent 18866ef commit ab40a9a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/components/tile-manager/controllers/tile-dnd.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ export class TileDragAndDropController implements ReactiveController {
4949
}
5050
}
5151

52-
public hostConnected(): void {
52+
public hostUpdate(): void {
5353
this._host.draggable = this.enabled;
54+
}
5455

56+
public hostConnected(): void {
5557
for (const type of DragEvents) {
5658
this._host.addEventListener(type, this);
5759
}

src/components/tile-manager/tile-dnd.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,13 @@ describe('Tile drag and drop', () => {
172172
const eventSpy = spy(tileManager, 'emitEvent');
173173
const tileWrapper = getTileBaseWrapper(draggedTile);
174174

175+
expect(draggedTile.draggable).to.be.true;
175176
expect(tileWrapper.getAttribute('part')).to.include('draggable');
176177

177178
draggedTile.disableDrag = true;
178179
await elementUpdated(tileManager);
179180

181+
expect(draggedTile.draggable).to.be.false;
180182
expect(tileWrapper.getAttribute('part')).to.not.include('draggable');
181183

182184
await dragAndDrop(draggedTile, dropTarget);

0 commit comments

Comments
 (0)