Skip to content

Commit 9493839

Browse files
committed
Resizable: correct width when grid approaches zero
Fixes #10590
1 parent 337e411 commit 9493839

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/unit/resizable/resizable_options.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,12 @@ test( "grid - maintains grid with padding and border when approaching no dimensi
310310
height: 80
311311
}).resizable({
312312
handles: "all",
313-
grid: 50
313+
grid: [ 50, 12 ]
314314
});
315315

316316
TestHelpers.resizable.drag( handle, 50, 50 );
317317
equal( target.outerWidth(), 50, "compare width" );
318-
equal( target.outerHeight(), 50, "compare height" );
318+
equal( target.outerHeight(), 52, "compare height" );
319319
});
320320

321321
test("ui-resizable-se { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() {

ui/resizable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@ $.ui.plugin.add("resizable", "grid", {
11701170
that.size.width = newWidth;
11711171
that.position.left = op.left - ox;
11721172
} else {
1173-
newWidth = gridY - outerDimensions.height;
1173+
newWidth = gridX - outerDimensions.width;
11741174
that.size.width = newWidth;
11751175
that.position.left = op.left + os.width - newWidth;
11761176
}

0 commit comments

Comments
 (0)