Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

JQMIGRATE: jQuery.fn.offset() requires an element connected to a document #830

Open
MichaelRoosz opened this issue Jun 13, 2017 · 0 comments

Comments

@MichaelRoosz
Copy link

MichaelRoosz commented Jun 13, 2017

This line in "src/position/viewport.js" throws the warning "JQMIGRATE: jQuery.fn.offset() requires an element connected to a document" when position.viewport is $('html'):

viewportOffset = viewport.offset() || adjusted;

This fixes it:

	var docElem = (viewport.ownerDocument || document).documentElement;
	if ($.contains(docElem, viewport)) {
            viewportOffset = viewport.offset() || adjusted;
	}
	else {
	    viewportOffset = adjusted;
	}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant