I was encountering the following warning while using jquery-sortable 0.9.13 (from 2015) with jQuery 3.2.1 and the unminified version of jQuery Migrate 3.1.0.
jQuery.fn.offset() requires an element connected to a document
I reviewed the sortable plugin, determined what jQuery Migrate was doing to provide fallback support and made the following edit to function getRelativePosition() on line 190.
function getRelativePosition(pointer, element) {
var docElem = ( element.ownerDocument || window.document ).documentElement;
var offset = { top: 0, left: 0 };
if ( $.contains(docElem, element) ) {
offset = element.offset();
}
...
This appears to works correctly now with jQuery 3.x. Please review and determine if there are any problems with this approach. Thanks.