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 with virtual scroll reverses order of items #15473

Open
dimmank opened this issue Mar 14, 2019 · 6 comments
Open

Drag drop with virtual scroll reverses order of items #15473

dimmank opened this issue Mar 14, 2019 · 6 comments
Labels
area: cdk/drag-drop area: cdk/scrolling P4 A relatively minor issue that is not relevant to core functions

Comments

@dimmank
Copy link

dimmank commented Mar 14, 2019

What is the expected behavior?

Adding cdkDrag to an item in a cdkVirtualFor should not reverse the list order

What is the current behavior?

Adding cdkDrag to an item in a cdkVirtualFor reverses the list order

What are the steps to reproduce?

https://angular-qcyrur.stackblitz.io

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular: 7.2.9
Angular Material: 7.3.4
OS: any
Browser: any

Is there anything else we should know?

@Halt001
Copy link

Halt001 commented Jun 3, 2019

We are seeing this too after upgrading Angular Material to: 7.3.7 from 7.3.3.
Any news on the cause or workaround is appreciated.

Edit:
The workaround in our case was to replace <ng-container *cdkVirtualFor="..."> with <div *cdkVirtualFor="...">

@josephperrott josephperrott added the P4 A relatively minor issue that is not relevant to core functions label Jun 4, 2019
@asmodeus812
Copy link

Is there an update on that ? Also we are noticing that for huge data sizes the data is shown in wrong order when using the cdkVirtualFor for After closing and reopening the select the items 'sometimes' show up in a correct order.

@entilzah
Copy link

Hi, we have the same problem. The workaround from @Halt001 not working for us. I found this example: https://stackblitz.com/edit/drag-drop-virtual-scroll

@mbrankintrintech
Copy link

Any update on this? We are seeing the same behaviour as shown in @entilzah example.

@ct5845
Copy link

ct5845 commented Dec 23, 2019

Same issue, tried wrapping in ng-container or on the item. No difference. https://stackblitz.com/edit/drag-drop-virtual-scroll as posted by entlizah best example of this. Remove the cdkDrag attributes and it works.

Currently stopping me from using virtual scroll, which is a real pain.

@mbrankintrintech
Copy link

This is fixed if you upgrade to angular 8 and the latest angular material.

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

No branches or pull requests

8 participants