Skip to main content

Search and Top Navigation

#6952 closed bug (wontfix)

Opened February 07, 2011 02:03PM UTC

Closed February 07, 2011 02:35PM UTC

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());

Attachments (0)
Change History (1)

Changed February 07, 2011 02:35PM UTC by scottgonzalez comment:1

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().