It was a simple dialog, as shown below, its height decreases whenever the dialog is dragged. Its height value even changes when I set the dialog resizable = false. Finally, I fixed it using the re-update height in the dragStop event handler.
I found that a similar problem was reported here , but it was with IE that the author suggested not setting the height value, which IMHO is not suitable for all use cases.
I am using Chrome and jQuery UI 1.8.19
<p><a id="edit" href="#">Open Editor</a></p> <div id="editor"></div> $(document).ready(function () { $("#edit").on("click", function () { var $dialog = $("#editor") .dialog( { title: "HTML Editor", modal: true, autoOpen: false, width: 600, height: 350, minWidth: 300, minHeight: 200, closeOnEscape: true, resizable: false, open: function () { }, buttons: { "Save": function () { $(this).dialog("close"); }, "Cancel": function () { $(this).dialog("close"); } }, dragStop: function (e, ui) { $(this).dialog("option", "height", "377px"); } }); } $dialog.dialog("open"); return false; }); });
Update 1: I just created a new project (ASP.NET MVC 4) and found that the problem occurred when I used the CSS rule, why?
* { margin: 0; padding: 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
source share