I am working with a jQuery UI Dialog and a Select2 element inside it. As soon as I click on the INPUT the Select2 does it's job and display a box with search results as the following image shows:
As you may notice the dialog doesn't grow up and fits the content and I can't find how to fix this. The code I have currently is this one:
$('#addSegToUsrDlg').dialog({
autoOpen: true,
modal: true,
resizable: false,
width: 400,
minHeight: "auto"
});
And I should said I have tried also setting resizable: true
without success. I have read all this topics about the same issue:
- Make JQuery UI Dialog automatically grow HEIGHT to fit its contents (width remains static)
- Automatically resize jQuery UI dialog to the width of the content loaded by ajax
- Make JQuery UI Dialog automatically grow or shrink to fit its contents
And apparently them make it work although none talks about Select2. I don't know if the problem is related to the SPAN element that Select2 creates meaning I don't know if a SPAN is capable to make a DIV grow up.
Any advice or solution?
I have created a jsFiddle here showing the issue