#12647 closed bug (notabug)
jQuery 1.8 + jQuery UI 1.8.17 = broken outerWidth and outerHeight functions
Reported by: | 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.
Change History (8)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
Use the latest jQuery UI.
comment:3 Changed 10 years ago by
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:
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 ;)
comment:4 Changed 10 years ago by
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?
comment:5 Changed 10 years ago by
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.
comment:6 Changed 10 years ago by
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.
comment:8 Changed 10 years ago by
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.
PS here's a jsfiddle http://jsfiddle.net/delvarworld/yxDHu/