JSFiddle - React, Tailwind, and code Playground
HTML
<div id="dialog">
<div id="content">
When you click me, my dialog will resize and all will be right!<br><br>
But if you click me after having resized the dialog, my width will not auto-change anymore :( so i'm sad.</div>
</div>
CSS
#dialog {
padding: 0px;
}
#content {
width: 100%;
color:white;
background: red;
}
.ui-dialog .ui-dialog-content {
background : #cacaca;
}
JavaScript
$("#dialog").dialog();
$("#content").click(function () {
$("#dialog").dialog("widget").animate({
left: 0,
top: 0,
width: $(document).width() -100,
height: $(document).height() -100
}, 150);
});
/* Steps to reproduce:
* * * * * * * * * * * * * * * *
* Click the red content. the dialog resizes.
* Resize it manually. It behaves good.
* Click again. It's not working anymore.
*/