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() calculated incorrectly for elements inside a table #4431
Comments
Thanks. We need to double check the difference between the while ( offsetParent &&
( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
jQuery.css( offsetParent, "position" ) === "static" ) {
offsetParent = offsetParent.parentNode;
} |
@gibson042 since this code was added by you in 1d2df77, do you know what it's supposed to do? |
Hello! I can concur that the position function is STILL broken, and it looks like it broke in version 3.3.0. I have a paragraph tag inside a table column that appears to the far right on my page. I just tested my application with 3.2.1 and the position is returning the correct top & left positions; when I switch to 3.3.0+ it returns left: 15, top: 13. Please compare between those two versions to determine the location of the bug. |
Ref #3479 |
The security guy at our company asks me every month for the past 2 years to upgrade our jQuery 3.1.1 to the latest and every month I have to explain all over again that it will break our UI. In order to maintain my sanity and avoid unnecessary rage outbreaks which will lead to me getting fired, can someone please fix this already? Much appreciated. |
@alons1 PRs welcome. If you care about something being fixed, you can speed it up by fixing that yourself & sending a PR. |
@mgol I'm unfamiliar with the project. |
@alons1 The desire not to screw things up is why this ticket isn't moving. If the solution to this was obvious and we were certain we could do it without screwing something up, it would have been done long ago. Someone needs to take the time to research the problem, look at any discussion when the change occurred and the tickets it was trying to fix, namely the ones mentioned in the 1d2df77 commit: gh-3080, gh-3107, gh-3096, gh-3487. Then someone needs to create a fix that works for all the supported browsers, including a test to prevent a regression. The second part is often easier than the research for the first! |
I am pretty sure the && before the jQuery.css( offsetParent, "position" ) === "static" should be a || But, the entire logic should be re-evaulated. Sorry I don't have time to do a PR request but that change solved my immediate problem with trying to get an element position from inside a table tr td. |
It seems this PR might fix the problem #4861 |
I've opened a bug in the past - #4149
It was closed and as far as I see, all linked issues to it are also closed.
So this should be fixed by now right?
Reproduces in Chrome / Firefox / Edge / IE11
https://jsfiddle.net/sectioni/pex37w8a/7/
The text was updated successfully, but these errors were encountered: