#7766 closed bug (fixed)
Resizable: Using invalid jQuery css parameter
Reported by: | urkle | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.12.0 |
Component: | ui.resizable | Version: | 1.8 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
In jquery.ui.resizale.js (against master) line 839 is the following.
avoid IE jump (hard set the margin) this.originalElement.css({ margin: this.originalElement.css('margin') });
Using .css('margin') is not supported by jquery (according to http://api.jquery.com/css/)
"Shorthand CSS properties (e.g. margin, background, border) are not supported. For example, if you want to retrieve the rendered margin, use: $(elem).css('marginTop') and $(elem).css('marginRight'), and so on."
From my testing of another widget we are using which was incorrectly doing this as well it was causing thrown errors of "invalid argument" when fetching the margin for an input element containing the following margn
"0 0 1px 0".
This can be seen with this fiddle.. in IE 7 and IE 8.
http://jsfiddle.net/cCGeW/5/embedded/result/
The solution is to use the individual marginLeft, marginTop, etc..
Change History (6)
comment:1 Changed 11 years ago by
Version: | git → 1.8 |
---|
comment:2 Changed 10 years ago by
Milestone: | 1.9.0 → 2.0.0 |
---|
comment:3 Changed 10 years ago by
Summary: | ui.resizable using invalid jquery css parameter → Resizable: Using invalid jQuery css parameter |
---|
The attached fiddle no longer produces an error in IE <= 9 as of jQuery 1.7.2 (http://jsfiddle.net/tj_vantoll/9ZRx8/). I believe this was the fix in question https://github.com/jquery/jquery/commit/6aa4095ed62.
That being said the referenced shorthand property is still used in the code (https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.resizable.js#L85).
comment:4 Changed 10 years ago by
Status: | new → open |
---|
Yeah, this is open, because retrieving shorthand properties is not supported. http://api.jquery.com/css/
"Shorthand CSS properties (e.g. margin, background, border) are not supported. For example, if you want to retrieve the rendered margin, use: $(elem).css('marginTop') and $(elem).css('marginRight'), and so on."
comment:5 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Resizable: Don't use CSS shorthand properties with .css()
Fixes #7766 Closes gh-1644
Changeset: 6a681c2c13afb6e76a6881b9dae928b9ff66a395
comment:6 Changed 7 years ago by
Milestone: | 2.0.0 → 1.12.0 |
---|
This is not something that has changed.