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
- Set window.jQuery, otherwise undefined, to
{ clone: () => console.log("what is this") }
- Start dragging a Sortable element.
- 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
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 tojQuery.clonehas some catastrophic results. Withoutjquery-sortablejsinstalled, I think it's reasonable to expect that core Sortable won't be reaching for jQuery at all.To Reproduce
{ clone: () => console.log("what is this") }Expected behavior
element.cloneNodeis used.Information
sortablejs= ^1.15.6@types/sortablejs= ^1.15.8