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

bug(Drag & Drop): cdkDropListSorted emitted multiple times with single item #23575

Closed
sanderschnydrig opened this issue Sep 13, 2021 · 1 comment · Fixed by #23589
Closed
Assignees
Labels
area: cdk/drag-drop P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@sanderschnydrig
Copy link

Reproduction

https://stackblitz.com/edit/angular-eijk13?file=src%2Fapp%2Fcdk-drag-drop-sort-predicate-example.ts

Steps to reproduce:

  1. Drag item in list
  2. Move item around on top of the list

Expected Behavior

I expected the dropListSorted Event to be emitted 0 times while still inside the same container

Actual Behavior

The event is being emitted many times while dragging over the droplist

Environment

  • Angular: 11-12
  • CDK/Material: 12.2.1 / 9.2.0
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10
@sanderschnydrig sanderschnydrig added the needs triage This issue needs to be triaged by the team label Sep 13, 2021
@crisbeto crisbeto self-assigned this Sep 15, 2021
@crisbeto crisbeto added area: cdk/drag-drop has pr P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs triage This issue needs to be triaged by the team labels Sep 15, 2021
crisbeto added a commit to crisbeto/material2 that referenced this issue Sep 15, 2021
…em list

Fixes that the `sorted` event was being emitted when the item wasn't actually being sorted when it's inside of a list with a single item.

Fixes angular#23575.
wagnermaciel pushed a commit that referenced this issue Sep 16, 2021
…em list (#23589)

Fixes that the `sorted` event was being emitted when the item wasn't actually being sorted when it's inside of a list with a single item.

Fixes #23575.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: cdk/drag-drop P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants