New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.position() returns an offset from the static element on IE and Edge #4407
Comments
Thanks for the report. Can you provide a test case on JS Bin as the issue template requested? Thanks! Also, please put code snippets in backticks: |
test case: Chrome(or FF, Safari) and Edge(or IE) have different results. I'm sorry and I learned code formatting. thank you. |
Hmm, when I look at the code, the while loop does look odd... while ( offsetParent &&
( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
jQuery.css( offsetParent, "position" ) === "static" ) {
offsetParent = offsetParent.parentNode;
} I think the only thing that will be done here is set @gibson042 I must be missing something. |
This block will be replaced when we address #3479 |
Since #3479 has been scheduled for |
The following code is an implementation of .position() from jquery-3.4.1.js.
Does the
.position()
need the parent of root only ?I do not think so.
If so, the code should be "if" and not "while".
is not repeat condition, it is break condition I think.
In IE and Edge, if the target element in the table, the .position() returns offset from the table-cell (it's IE and Edge's offsetParent).
I guess the code is intended to be:
Note by @mgol: I edited the post to add code formatting. (2019-07-01)
The text was updated successfully, but these errors were encountered: