The maximum width of the dialog box does not affect when the width is set to auto


I'm trying to make the dialog use auto width and height, but only up to a certain width. But the maxWidth does not take affect till I manually resize the opened dialog.

How can I automatically trigger the check for the width?

Example code:

Never done much work with jQuery UI. But here's a fix for what you've got there, obviously I've set the maxWidth to 50px, so change it!


var myDialog = $("#myDialog").dialog({
    autoOpen: false,
    maxWidth: "50px",
    height: 'auto',