muuri
muuri copied to clipboard
Contain dragged element's movement within a container
This: http://api.jqueryui.com/sortable/#option-containment
This is definitely a useful feature, but I wonder what should happen if the dragged element is outside the containment area when dragging starts? Snap edge to containment area? Allow moving the item only towards to containment area? Or what about if the item is larger than the containment area?
The tricky part here is handling the edge cases.
And if a selector/element is used to define the containment area when do we fetch/update the containment area's dimensions and offsets? On initialization? On drag start? On scroll? On all of those events?
how do we achieve this in muuri, to only drag items inside its parent div?
niklasramo can u help on this?
@arunkmr25 did you have a workaround for this?