Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drag Drop: mat-grid-tile does not retain height when being dragged #14417

Open
ducalai opened this issue Dec 7, 2018 · 1 comment
Open

Drag Drop: mat-grid-tile does not retain height when being dragged #14417

ducalai opened this issue Dec 7, 2018 · 1 comment
Labels
area: cdk/drag-drop P4 A relatively minor issue that is not relevant to core functions

Comments

@ducalai
Copy link

ducalai commented Dec 7, 2018

What is the expected behavior?

When dragging an item in a list, element rendered next to the user's cursor should look exactly like the element that is being dragged.

What is the current behavior?

Height changes and becomes bigger when item is being dragged

What are the steps to reproduce?

I use Mat-Grid-List example available in the docs at https://stackblitz.com/angular/oegmxkolgyr?file=app%2Fgrid-list-overview-example.html

Just display it on one line because of "Drag Drop Sortable, mixed orientation support (#13372 )" bug and add drag/drop like this:

<mat-grid-list cdkDropList cdkDropListOrientation="horizontal" cols="4" rowHeight="2:1">
  <mat-grid-tile cdkDrag>1</mat-grid-tile>
  <mat-grid-tile cdkDrag>2</mat-grid-tile>
  <mat-grid-tile cdkDrag>3</mat-grid-tile>
  <mat-grid-tile cdkDrag>4</mat-grid-tile>
</mat-grid-list>

image

When rowHeight is set to a ratio, height of item being drag changes.

Any solution to keep height at correct ratio?

@mmalerba mmalerba added the needs triage This issue needs to be triaged by the team label May 20, 2020
@crisbeto crisbeto added area: cdk/drag-drop P4 A relatively minor issue that is not relevant to core functions and removed needs triage This issue needs to be triaged by the team labels May 25, 2020
@nzbin
Copy link

nzbin commented Aug 2, 2023

It can be very easy to implement this feature with the ng-dnd library, please check the following example.
https://stackblitz.com/edit/867pxw?file=src%2Fexample%2Fchips-drag-drop-example.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cdk/drag-drop P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

No branches or pull requests

4 participants