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

(CdkDrag): Add Parent Container functionality for Draggable elements #14282

Closed
tx-ares opened this issue Nov 26, 2018 · 3 comments
Closed

(CdkDrag): Add Parent Container functionality for Draggable elements #14282

tx-ares opened this issue Nov 26, 2018 · 3 comments

Comments

@tx-ares
Copy link

tx-ares commented Nov 26, 2018

Bug, feature request, or proposal:

Add functionality to define a parent container for a draggable element to be constrained to to prevent dragging off bounds.

What is the expected behavior?

Be able to define a parent container with a selector , ( e.g cdkDragParent ) so that a draggable element can not be dragged outside the container.

What is the current behavior?

You are able to drag items off screen leaving you no way to bring it back into view without refreshing the page.

What are the steps to reproduce?

Issue is visible in the demo section for Material:

  1. Visit: https://material.angular.io/cdk/drag-drop/overview

  2. Scroll down to "Alternate drag root element" section.

  3. Click on "Open a draggable dialog" button.

  4. Drag the modal off screen, and click anywhere to close it.

  5. Click on "Open a draggable dialog" button again.

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

I am using cdkDrag for draggable modals. Although I have no need for the "drop" feature of cdkDrag it would be very helpful to be able to define containers that a draggable item could be constrained to.

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

Angular 6.0.3,
CDK 7.0.0,
Typescript 2.7.2

Is there anything else we should know?

@crisbeto
Copy link
Member

See #14242.

@tx-ares
Copy link
Author

tx-ares commented Nov 27, 2018

Thank you! Any ETA on when that will be merged? @crisbeto

@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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants