Skip to content

feat(drag-drop): add the ability to disable sorting in a list #15064

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

Merged
merged 1 commit into from
Feb 22, 2019

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Feb 2, 2019

Adds the ability to disable sorting inside of a CdkDropList. This allows for use cases where one list is considered the source and one or more connected lists are the destinations, and the user isn't supposed to sort the items within the source list.

Fixes #14838.

@crisbeto crisbeto added the target: minor This PR is targeted for the next minor release label Feb 2, 2019
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 2, 2019
@crisbeto crisbeto force-pushed the 14838/drag-drop-disable-sorting branch from 264a689 to 2865ac8 Compare February 2, 2019 15:52
@LordMidi
Copy link

Thanks for implementing. When can we expect this feature to be merged?

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

const currentIndex = this._activeDraggables.indexOf(item);
const newPositionReference = this._activeDraggables[newIndex];
// If sorting is disabled, we want the item to return to its starting
// position, if the user is returning it to its initial container.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: omit comma after "position"

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Feb 20, 2019
Adds the ability to disable sorting inside of a `CdkDropList`. This allows for use cases where one list is considered the source and one or more connected lists are the destinations, and the user isn't supposed to sort the items within the source list.

Fixes angular#14838.
@crisbeto crisbeto force-pushed the 14838/drag-drop-disable-sorting branch from 2865ac8 to 9cb2afc Compare February 20, 2019 06:57
@jelbourn jelbourn merged commit 629460f into angular:master Feb 22, 2019
crisbeto added a commit to crisbeto/material2 that referenced this pull request Mar 9, 2019
Documents the functionality from angular#15064 and adds a live example.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Mar 9, 2019
Documents the functionality from angular#15064 and adds a live example.
mmalerba pushed a commit that referenced this pull request Mar 11, 2019
Documents the functionality from #15064 and adds a live example.
Suresh918 pushed a commit to Suresh918/material2 that referenced this pull request Apr 15, 2019
@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 Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[drag-drop] Allow to disable sorting within a CdkDropList
4 participants