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: Provide option to enable/disable dragging of elements #13651

Closed
philmtd opened this issue Oct 17, 2018 · 5 comments · Fixed by #13722
Closed

drag-drop: Provide option to enable/disable dragging of elements #13651

philmtd opened this issue Oct 17, 2018 · 5 comments · Fixed by #13722
Assignees
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix

Comments

@philmtd
Copy link

philmtd commented Oct 17, 2018

Bug, feature request, or proposal:

feature request

What is the expected behavior?

I would like to be able to make drag-drop toggleable. e.g.
<div [cdkDrag]="shouldDragBeEnabled()"></div>
or
<div cdkDrag [cdkDragEnabled]="shouldDragBeEnabled()"></div>

Maybe even for whole cdkDropList elements, affecting all draggable child elements.

What is the current behavior?

Elements with cdkDrag are always draggable.

What is the use-case or motivation for changing an existing behavior?

We're making an editor for documents and we have draggable components inside this editor. Users can open documents in a read only mode (e.g. when someone else is working on a document) and in this mode the normally draggable elements should not be draggable.

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

7.0.0-rc.2

@philmtd philmtd changed the title drag-drop: Provide option to enable/disable dragging of items drag-drop: Provide option to enable/disable dragging of elements Oct 17, 2018
@crisbeto crisbeto self-assigned this Oct 17, 2018
@crisbeto crisbeto added the feature This issue represents a new feature or feature request rather than a bug or bug fix label Oct 17, 2018
@philmtd
Copy link
Author

philmtd commented Oct 18, 2018

It would also be nice to have an option to disable certain cdkDragHandles dynamically. This would allow to improve the drag & drop user experience of an app on smaller screens.

crisbeto added a commit to crisbeto/material2 that referenced this issue Oct 21, 2018
Adds inputs to `cdkDrag`, `cdkDropList` and `cdkDragHandle` that allows for dragging to be disabled through those specific elements.

Fixes angular#13651.
@100cm
Copy link

100cm commented Oct 24, 2018

@crisbeto Hi, when will the pr merged?

crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 4, 2018
Adds inputs to `cdkDrag`, `cdkDropList` and `cdkDragHandle` that allows for dragging to be disabled through those specific elements.

Fixes angular#13651.
@ikismail
Copy link

ikismail commented Nov 7, 2018

will this PR merged ? @crisbeto

@100cm
Copy link

100cm commented Nov 7, 2018

@crisbeto Hi, when will the pr merged?

i can't wait for this

crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 8, 2018
Adds inputs to `cdkDrag`, `cdkDropList` and `cdkDragHandle` that allows for dragging to be disabled through those specific elements.

Fixes angular#13651.
andrewseguin pushed a commit that referenced this issue Nov 14, 2018
Adds inputs to `cdkDrag`, `cdkDropList` and `cdkDragHandle` that allows for dragging to be disabled through those specific elements.

Fixes #13651.
IlCallo pushed a commit to IlCallo/material2 that referenced this issue Nov 15, 2018
Adds inputs to `cdkDrag`, `cdkDropList` and `cdkDragHandle` that allows for dragging to be disabled through those specific elements.

Fixes angular#13651.
josephperrott pushed a commit that referenced this issue Nov 19, 2018
Adds inputs to `cdkDrag`, `cdkDropList` and `cdkDragHandle` that allows for dragging to be disabled through those specific elements.

Fixes #13651.
@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
feature This issue represents a new feature or feature request rather than a bug or bug fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants