And Wan And Wan - 19 days ago 6
jQuery Question

jquery-ui dialogs lose auto size

In IE is fine.
But in FF/Chrome, create a modal dialog, with width/height as auto, eg.

$('<div id="testPopup"></div>').dialog({
modal: true,
title: data.title,
width: "auto",
height: "auto",


Then if the dialog dynamically adds new buttons, the dialog is expands/resizes fine. However, if you drag/move the dialog, then the width/height attributes are replaced with exact numeric values. Then adding new buttons dynamically will be squashed or even can't be shown.

I've tested this in both jquery-ui 1.11.4 and 1.12.1

Anyone know how to fix this?

Answer

add attributes

draggable: true dragStop: function(event, ui) {...}

need to test for not being isieversion() then temporarily store the width ($(this).dialog("option", "width")) and then setting it again.