I had a similar problem.
Setting width
to "auto"
worked fine for me but when the dialog contained a lot of text it made it span the full width of the page, ignoring the maxWidth
setting.
Setting maxWidth
on create
works fine though:
$( ".selector" ).dialog({
width: "auto",
// maxWidth: 660, // This won't work
create: function( event, ui ) {
// Set maxWidth
$(this).css("maxWidth", "660px");
}
});