Changing DOM order after drag and drop
it is possible to change DOM elements after changing their location with packery?
Here's an example that uses Draggabilly and changes the order once it's been 'dropped' http://codepen.io/chriscoyier/pen/BvcKq
It was written up in CSS Tricks!
http://css-tricks.com/draggable-elements-push-others-way/
+1 this issue if you would like to see this feature added to Packery.
There is a bug on your code,
http://codepen.io/desandro/pen/cbhDG
When you drag the "first" item to the "last one" the DOM doesn't change and error in console appear.
Do you have any ideas? I'm really struggling to find the error.
I will appreciate all your help
Good catch, fixed! http://codepen.io/desandro/pen/cbhDG
The other issue I have is if I have like 40 or 60 items long on the page, the page doesn't scroll with the item I'm dragging. Like if push item 40th to 1st on the top. Make sense
@carlosdv4 Yes. I've documented that feature request in desandro/draggabilly#1
@desandro Thanks for the code, but I notice that your code is only for one-dimensional identically shaped DOM elements. How would it work for a two-dimensional grid with elements of varying size?
In this case some elements are moved to fill in space, but the DOM doesn't get updated for those elements that are automatically moved. How would you modify the DOM for those automatically moved elements?