Skip to main content

Bug Tracker

Side navigation

#12647 closed bug (notabug)

Opened October 03, 2012 10:56PM UTC

Closed October 03, 2012 11:04PM UTC

Last modified September 11, 2013 01:25PM UTC

jQuery 1.8 + jQuery UI 1.8.17 = broken outerWidth and outerHeight functions

Reported by: delvarworld@yahoo.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:
Description

$(document.body).outerWidth() now returns the jQuery object instead of a number.

jQuery 1.8 does not seem to be backwards compatible with jQuery UI.

Attachments (0)
Change History (8)

Changed October 03, 2012 11:00PM UTC by anonymous comment:1

Changed October 03, 2012 11:04PM UTC by dmethvin comment:2

resolution: → notabug
status: newclosed

Use the latest jQuery UI.

Changed October 03, 2012 11:17PM UTC by delvarworld@yahoo.com comment:3

Update: It's because this line in jQuery UI:

return orig[ "outer" + name ].call( this, size );

is erroneously triggering this condition in jQuery 1.8:

var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),

because even though size is undefined, the check is for arguments.length. chainable should be false here. You can pass in undefined and it will still make arguments an object with length 1. Someone needs to read up on their JS ;)

Changed October 03, 2012 11:20PM UTC by anonymous comment:4

unfortunately I can't use the latest jQuery ui because of some dependent plugins. I was under the impression jquery is supposed to be backwards compatible. is that not the case?

Changed October 03, 2012 11:57PM UTC by scottgonzalez comment:5

jQuery is backward compatible. Calling .outerWidth() with undefined has never been a defined API. Can you elaborate on "because of some dependent plugins"? I assume you just updated jQuery core to a new major version, but you're saying that you can't update jQuery UI to a newer patch version.

Changed October 04, 2012 08:59PM UTC by anonymous comment:6

Oh, I see what you're saying. I agree that's not defined, but jQuery UI is (was) doing it.

We are specifically using a timepicker plugin which we've had to customize a bit. If we upgrade jQuery UI the plugin becomes unfunctional. There is a later version of it out, but because of the custom functionality and styling we've put in, we are currently blocked on the upgrade. Upgrading jQuery itself didn't seem to have any adverse affects on it.

I and one other person on stackoverflow have encountered this. Either way, a simple workaround is just to pass in false, which jQuery UI then passes through to the original function.

Changed July 16, 2013 12:01PM UTC by scottgonzalez comment:7

#14138 is a duplicate of this ticket.

Changed September 11, 2013 01:25PM UTC by anonymous comment:8

jQuery's API documentation shows the parameter as optional, says "If includeMargin is omitted or false", and gives an example with it omitted. I don't know how it used to be, but it's optional now, so jQuery UI is changing the interface, which should be documented at least.