xieziyu / angular2-draggable

Angular directive (for version >= 2.x ) that makes the DOM element draggable and resizable
https://xieziyu.github.io/angular2-draggable/
293 stars 103 forks source link

Snapping to other elements while dragging/resizing #162

Open JD-Robbs opened 5 years ago

JD-Robbs commented 5 years ago

Just putting it out there: snapping to other elements while dragging and resizing.

This could involve a "snapThreshold" value in, say, px - if you're within that range, it will snap to the respective element's/elements' boundaries.

This could be targeted by a list of selectors to snap to - e.g. "snapToSelectors".

xieziyu commented 5 years ago

Thank you. It's a great feature. I will think about it.

mark-at-tusksoft commented 2 months ago

Trying to figure out how to do this for our project as well. using resize and need it to snap to other elements on a 2D bar when within a threshold.