#12706 closed bug (notabug)
.offset() is off by 8px in IE9 in some cases
Reported by: | scottgonzalez | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.8.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I'm not sure exactly what is required for this, but it seems that at a minimum there needs to be html { height: 100%; }
and body { height: 100% margin: 0; }
as well an absolutely positioned element.
The first time .offset()
is called, the left value is off by 8 pixels. Subsequent calls are correct.
Original jQuery UI ticket: http://bugs.jqueryui.com/ticket/8656
Change History (4)
comment:1 Changed 10 years ago by
Owner: | set to scott.gonzalez |
---|---|
Status: | new → pending |
comment:2 Changed 10 years ago by
Owner: | scott.gonzalez deleted |
---|---|
Status: | pending → new |
They should be the same, since the text field doesn't move. Interestingly I get consistent results in Chrome.
comment:4 Changed 10 years ago by
In case anyone comes across this in the future...The test case was supposed to have the ul
absolutely positioned so that it wasn't affecting the flow. I forgot to add that in the fiddle, but adding that doesn't change the behavior anyway. It turns out to be related to top: auto
(default) on absolutely positioned elements. Explicitly setting the top
made this behave as expected. This may still be a bug, but it just seems like incorrect browser behavior and an edge case with all the CSS that was required to cause this happen. Lastly, the behavior was as expected for me in Chrome 21 and Canary on OS X, but "broken" in every other browser, including Chrome on Windows
So should the two numbers be the same? They aren't in Chrome (146.5 vs 155 = 8.5), Firefox (92.58332824707031 vs 99.66667175292969 = 7.08), Safari5 (198 vs 206 = 8) and yes IE9 (101 vs 110 = 9).