Opened 3 years ago

#14979 new bug

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:

Description

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.

Change History (0)

Note: See TracTickets for help on using tickets.