packery
packery copied to clipboard
Auto layout after item drag/drop has a different behavior than explicitly calling "layout"
Check the case here: http://jsfiddle.net/omarkth/px6932qb/3/
Steps:
- Drag the green box and drop it in the middle of the screen, it will auto-layout and the green box will return to the top of the page (top=0) but the (left) remains the same as where it was dropped
- Press the "Layout" button, the green box will stack next to the purple box (green left = purple width)
Problem: Is this normal? how can I achieve the final result of this without having to call the layout explicitly? simply, I need all the boxes to be auto aligned next to each other after the drag/drop.
Thanks for reporting this issue and providing a test case :)
Is this normal?
Yes, this is the intended behavior. The Drag & drop logic works a bit different from normal layout logic: the dragged item is positioned first and all other items are laid out around it.
Having the drag position be the same as the laid-out position is a legitimate request. Closing this issue here as a duplicate of #4.