Skip to content

Commit ce0afde

Browse files
JamesKhouryscottgonzalez
authored andcommitted
Dialog: Modified the dialog._size() to use outerHeight in calculating the nonContentHeight. Fixed #7692 - dialog: dialog height bug is incorrect when .ui-dialog padding set.
1 parent 06f6fa8 commit ce0afde

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Diff for: tests/unit/dialog/dialog_options.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -177,19 +177,24 @@ test("draggable", function() {
177177
});
178178

179179
test("height", function() {
180-
expect(3);
180+
expect(4);
181181

182182
el = $('<div></div>').dialog();
183-
equals(dlg().height(), 150, "default height");
183+
equals(dlg().outerHeight(), 150, "default height");
184184
el.remove();
185185

186186
el = $('<div></div>').dialog({ height: 237 });
187-
equals(dlg().height(), 237, "explicit height");
187+
equals(dlg().outerHeight(), 237, "explicit height");
188188
el.remove();
189189

190190
el = $('<div></div>').dialog();
191191
el.dialog('option', 'height', 238);
192-
equals(dlg().height(), 238, "explicit height set after init");
192+
equals(dlg().outerHeight(), 238, "explicit height set after init");
193+
el.remove();
194+
195+
el = $('<div></div>').css("padding", "20px")
196+
.dialog({ height: 240 });
197+
equals(dlg().outerHeight(), 240, "explicit height with padding");
193198
el.remove();
194199
});
195200

Diff for: ui/jquery.ui.dialog.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ $.widget("ui.dialog", {
625625
height: "auto",
626626
width: options.width
627627
})
628-
.height();
628+
.outerHeight();
629629
minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
630630

631631
if ( options.height === "auto" ) {

0 commit comments

Comments
 (0)