Bug Tracker

Opened 9 years ago

Closed 9 years ago

#7602 closed bug (fixed)

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

Change History (5)

comment:1 Changed 9 years ago by jitter

Component: unfiledoffset
Priority: undecidedhigh
Status: newopen

comment:2 Changed 9 years ago by jitter

Owner: set to rholbrook
Status: openassigned

comment:3 Changed 9 years ago by Rick Waldron

#7976 is a duplicate of this ticket.

comment:4 Changed 9 years ago by anonymous

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

comment:5 Changed 9 years ago by john

Resolution: fixed
Status: assignedclosed

Landed pull 109.

Note: See TracTickets for help on using tickets.