Skip to content

Commit 84257e7

Browse files
committed
Draggable: Calling .refreshPositions instead of ._refreshItems when dragging with a connected sortable to force containerCache initialisation/update. Fixed: #5563 - connectToSortable misbehaves if the position of the sortable changes after the sortable and draggable have been initialised as _refreshItems no longer updating container cache.
1 parent 5bc57a8 commit 84257e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ui/jquery.ui.draggable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
477477
instance: sortable,
478478
shouldRevert: sortable.options.revert
479479
});
480-
sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache
480+
sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page).
481481
sortable._trigger("activate", event, uiSortable);
482482
}
483483
});

0 commit comments

Comments
 (0)