Skip to content

CdkDragDrop - Issues with dynamic height on CdkDropList #18638

Closed
@jingfee

Description

@jingfee

I'm using CdkDragDrop to make a dynamic grid which can be restructured with drag and drop from the user. I created this StackBlitz to illustrate both my use case and the issue I'm facing https://stackblitz.com/edit/angular-rvv4g9.

When I have two elements on the same row I would like to drop one of the elements on an empty row to separate them and create a new row. To do this I inserted empty rows inbetween all rows, when you drag an item they are illustrated with a red background. Since the elements I'm dragging have a rather large height I would like the empty rows to start out small, and when inserting items into them, make them expand.

The issue I'm facing is if you drag for example the element "1" over the row between it and the "3", you can see the row expand, then continue to drag the "1" down below the "3", and you cannot drop the item there.

I think the "drop-area" is not recalculated, and is being blocked by another element which has expanded.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions