Sortable icon indicating copy to clipboard operation
Sortable copied to clipboard

[bug] Core `clone` util uses JQuery without `jquery-sortablejs` installed

Open stwlam opened this issue 3 months ago • 0 comments

I'm writing a plugin for third-party software where jQuery is present in globalThis. My plugin, however, makes no use of it, and Sortable's clone util function diverting to jQuery.clone has some catastrophic results. Without jquery-sortablejs installed, I think it's reasonable to expect that core Sortable won't be reaching for jQuery at all.

To Reproduce

  1. Set window.jQuery, otherwise undefined, to { clone: () => console.log("what is this") }
  2. Start dragging a Sortable element.
  3. Observe console output (along with error since the above won't clone).

Expected behavior

element.cloneNode is used.

Information

sortablejs = ^1.15.6 @types/sortablejs = ^1.15.8

stwlam avatar Oct 10 '25 07:10 stwlam