packery icon indicating copy to clipboard operation
packery copied to clipboard

Auto layout after item drag/drop has a different behavior than explicitly calling "layout"

Open Omarkth opened this issue 11 years ago • 1 comments

Check the case here: http://jsfiddle.net/omarkth/px6932qb/3/

Steps:

  1. 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
  2. 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.

Omarkth avatar May 18 '15 10:05 Omarkth

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.

desandro avatar May 18 '15 12:05 desandro