Skip to content

Commit 0a0db09

Browse files
mikesherovscottgonzalez
authored andcommitted
Resizable: correct width when grid approaches zero
Fixes #10590 (cherry picked from commit 9493839)
1 parent 105f4a5 commit 0a0db09

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
@@ -311,12 +311,12 @@ test( "grid - maintains grid with padding and border when approaching no dimensi
311311
height: 80
312312
}).resizable({
313313
handles: "all",
314-
grid: 50
314+
grid: [ 50, 12 ]
315315
});
316316

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

322322
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
@@ -1165,7 +1165,7 @@ $.ui.plugin.add("resizable", "grid", {
11651165
that.size.width = newWidth;
11661166
that.position.left = op.left - ox;
11671167
} else {
1168-
newWidth = gridY - outerDimensions.height;
1168+
newWidth = gridX - outerDimensions.width;
11691169
that.size.width = newWidth;
11701170
that.position.left = op.left + os.width - newWidth;
11711171
}

0 commit comments

Comments
 (0)