Opened 9 years ago

Closed 9 years ago

#6952 closed bug (wontfix)

UI Position, target.offset() returns object with read only properties. Position attempts to change these and returns exception in Firefox 3.6

Reported by: shihouka Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.position Version: 1.8.9
Keywords: Cc:
Blocked by: Blocking:

Description

In some cases, Position uses object that has read only properties. Here are the code excerpts:

        } else {
		targetWidth = target.outerWidth();
		targetHeight = target.outerHeight();
		basePosition = target.offset();
	}

target.offset() is browser object with read only properties.

        if ( options.at[1] === "bottom" ) {
		basePosition.top += targetHeight;
	} else if ( options.at[1] === center ) {
		basePosition.top += targetHeight / 2;
	}

Exception gets thrown at basePosition.top += targetHeight; because it cant assign value to read only property.

Dirty solution i used:

basePosition = $.extend({},target.offset());

Change History (1)

comment:1 Changed 9 years ago by Scott González

Resolution: wontfix
Status: newclosed

This is caused by a bug in core, which has been fixed: http://bugs.jquery.com/ticket/7602

The work-around for now is insert the element into the DOM before calling .position().

Note: See TracTickets for help on using tickets.