Skip to main content

Search and Top Navigation

#14979 new bug ()

Opened May 30, 2016 03:42PM UTC

Last modified May 30, 2016 03:42PM UTC

When using custom placeholder, the positions of the items array needs to be refreshed after the placholder is set...

Reported by: joetidee Owned by:
Priority: minor Milestone: none
Component: ui.sortable Version: 1.11.4
Keywords: Cc:
Blocked by: Blocking:

If you are using a custom placeholder for a sortable list the placeholder replaces the item that is being dragged, when dragging starts. This causes the position calculations to be incorrect because the dimensions (specifically the height) of the placeholder might be different to the heigh it the item being dragged. This means that the position data held in the this.items object array is incorrect and therefore causes the intersection calculations to be incorrect.

I fixed this by updating the _mouseStart function, by adding this.refreshPositions() after the creation of the placeholder this._createPlaceholder(). This causes the this.items array to update with the correct positions after the placeholder has been rendered.

Attachments (0)
Change History (0)