angular-dragdrop icon indicating copy to clipboard operation
angular-dragdrop copied to clipboard

How to constrain the movement inside a parent element?

Open mxmzb opened this issue 9 years ago • 3 comments

Is it possible to constrain the movement of a draggable element inside another element, like shown in the jqueryui examples: https://jqueryui.com/draggable/#constrain-movement ?

mxmzb avatar Jul 01 '16 11:07 mxmzb

Yea I'm looking to do something very similar because when I drag my div I can keep moving it to the right of my screen and it will eventually be off the view of my webpage

williamk705 avatar Aug 12 '16 17:08 williamk705

Anyone have an update on this? I'm encountering the same issue.

owen-roberts avatar Feb 19 '18 15:02 owen-roberts

Solution was to add the 'containment' property to data-jqyoui-options, like so: data-jqyoui-options="{containment: '.draggable-container'}"

In this case I'm using the .draggable-container class to constrain the draggable elements.

owen-roberts avatar Feb 19 '18 15:02 owen-roberts