From c07f829be26c26d56d319aa8b80cfa8a2fbb297f Mon Sep 17 00:00:00 2001 From: Matt Stone Date: Mon, 13 Apr 2026 10:11:33 +1000 Subject: [PATCH] Respect `put: false` on the revert-to-origin path When a dragged item has left its source sortable and the cursor hovers back over it, _onDragOver enters the "revert" branch (line 1152) to move dragEl back to its origin. This branch checks `canSort` but never checks `group.checkPut`, so `put: false` is silently ignored for the owner sortable. The non-owner branch (line 1154-1158) already gates on `checkPut`. This change makes the owner branch symmetric: revert only proceeds if `checkPut` also allows it. Lists that declare `put: false` will no longer have their own items forcibly reinserted during a cross-list drag. Backward compatibility: only affects sortables that explicitly set `put: false`. The default (`put: true` or unset) is unchanged, because `checkPut` returns true. --- src/Sortable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sortable.js b/src/Sortable.js index 72f571c82..d7726c31a 100644 --- a/src/Sortable.js +++ b/src/Sortable.js @@ -1149,7 +1149,7 @@ Sortable.prototype = /** @lends Sortable.prototype */ { if (activeSortable && !options.disabled && (isOwner - ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list + ? canSort || ((revert = parentEl !== rootEl) && group.checkPut(this, activeSortable, dragEl, evt)) // Reverting item into the original list : ( putSortable === this || (