Closed reinert closed 2 years ago
Oh! BTW, I'm managing to achieve this https://github.com/desandro/masonry/issues/873
Thanks for this contribution. Rather than adding this code, I think you can achieve the same result by disabling the setLeftTop
on dragEnd. See demo http://codepen.io/desandro/pen/83ccea94d5eed8b730a7906b61299898
I had tried this, but the top/left original position of the element is not preserved as you move it many times. You can check it by moving, leaving in another place, and moving again.
@desandro the codepen doesn't work anymore because of https
@desandro I'm also interested in this, but @reinert is right. left/top
are still being set: https://codepen.io/aristidesfl/pen/GrVddQ
@reinert image dragging is not working in your fork, even without enabling the option https://codepen.io/aristidesfl/pen/KWKqjX
@reinert same with anchor tags: https://codepen.io/aristidesfl/pen/evYEpj
I'm not sure if that will make sense to you, but I'm using your (great!) lib along with some additional logic to make smooth repositioning of cards the same way Google Keep does. It is working great. But to achieve this, all my elements inside the container have left and top zero, and are positioned by the transform property. So I had to add an option to your lib to position the elements on drag end by the transform property instead of top/left properties. This patch doesn't change the default behavior.