aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorMatías Cánepa <matias.canepa@gmail.com>2022-10-10 06:00:50 -0300
committerGitHub <noreply@github.com>2022-10-10 11:00:50 +0200
commit62f2ccc5678a8b09df85afd006eb623ac38af189 (patch)
tree7330a203422d0ddd7a7c3f5f8293ac4cf0ea0de7 /ui
parent5fa0db48d73887facf891eb05b43c443b5baeca3 (diff)
downloadjquery-ui-62f2ccc5678a8b09df85afd006eb623ac38af189.tar.gz
jquery-ui-62f2ccc5678a8b09df85afd006eb623ac38af189.zip
Resizable: Fix resizing of elems with `box-sizing: border-box`
Fixes gh-1979 Closes gh-2012
Diffstat (limited to 'ui')
-rw-r--r--ui/widgets/resizable.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/ui/widgets/resizable.js b/ui/widgets/resizable.js
index d1abbd539..3f1f19833 100644
--- a/ui/widgets/resizable.js
+++ b/ui/widgets/resizable.js
@@ -533,15 +533,18 @@ $.widget( "ui.resizable", $.ui.mouse, {
if ( this.position.left !== this.prevPosition.left ) {
props.left = this.position.left + "px";
}
+
+ this.helper.css( props );
+
if ( this.size.width !== this.prevSize.width ) {
props.width = this.size.width + "px";
+ this.helper.width( props.width );
}
if ( this.size.height !== this.prevSize.height ) {
props.height = this.size.height + "px";
+ this.helper.height( props.height );
}
- this.helper.css( props );
-
return props;
},
@@ -1048,7 +1051,7 @@ $.ui.plugin.add( "resizable", "alsoResize", {
$( o.alsoResize ).each( function() {
var el = $( this );
el.data( "ui-resizable-alsoresize", {
- width: parseFloat( el.width() ), height: parseFloat( el.height() ),
+ width: parseFloat( el.css( "width" ) ), height: parseFloat( el.css( "height" ) ),
left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) )
} );
} );