Skip to main content

Bug Tracker

Side navigation

#7602 closed bug (fixed)

Opened November 22, 2010 11:39PM UTC

Closed January 18, 2011 07:20PM UTC

jQuery.fn.offset() returns ClientRect object for disconnected elements

Reported by: rholbrook Owned by: rholbrook
Priority: high Milestone: 1.5
Component: offset Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

Normally offset() returns a generic object with just top and left properties, however in the case of a disconnected element, it returns a ClientRect object instead. This causes problems for jQuery.fn.position(), which needs to modify properties of the returned object.

Tested on FireFox 3.5, IE 7, and Safari 5. Safari 5 doesn't throw an error, but silently fails to update the ClientRect object inside of position()

Example case: http://jsfiddle.net/Hm5w3/

Quick fix, forked from latest jQuery on Github

Attachments (0)
Change History (5)

Changed November 23, 2010 12:09AM UTC by jitter comment:1

component: unfiledoffset
priority: undecidedhigh
status: newopen

Changed November 23, 2010 12:15AM UTC by jitter comment:2

owner: → rholbrook
status: openassigned

Changed January 14, 2011 10:07PM UTC by rwaldron comment:3

#7976 is a duplicate of this ticket.

Changed January 18, 2011 01:37PM UTC by anonymous comment:4

How come you still haven't pulled the patch? See pull requests 109 or 168!

Changed January 18, 2011 07:20PM UTC by john comment:5

resolution: → fixed
status: assignedclosed

Landed pull 109.