From 663c8a7b3f475623f7773ea1eb7889af6e8327ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Afonso=20Janu=C3=A1rio?= Date: Fri, 4 Sep 2026 12:53:32 +0100 Subject: [PATCH] Stop core clone() from reaching for a global jQuery/Zepto clone() checked window.jQuery and window.Zepto and used their clone method whenever either happened to exist on the page, regardless of whether jquery-sortablejs was actually the thing driving Sortable. That means any page with jQuery loaded for unrelated reasons, but using plain SortableJS directly, silently got jQuery's clone instead of a native cloneNode, which breaks in interesting ways if that jQuery-like global doesn't behave exactly like real jQuery. Checked jquery-sortablejs itself: it never touches this function or relies on it reaching for jQuery internally, it just wraps Sortable in a $.fn plugin. So core has no real reason to special-case jQuery here at all, native cloneNode is what it should use unless something more specific (Polymer, in this file) says otherwise. Fixes GH-2453. --- src/utils.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/utils.js b/src/utils.js index 43112a4d3..6464e3d49 100644 --- a/src/utils.js +++ b/src/utils.js @@ -511,14 +511,10 @@ function scrollBy(el, x, y) { function clone(el) { let Polymer = window.Polymer; - let $ = window.jQuery || window.Zepto; if (Polymer && Polymer.dom) { return Polymer.dom(el).cloneNode(true); } - else if ($) { - return $(el).clone(true)[0]; - } else { return el.cloneNode(true); }