If you're using a recent version of Muse (2015.2+) you can set the widget to be responsive in both width and height using the supportedSizePolicies attribute of the HTMLWidget declaration.
I'm not sure if this will fix your issue, however; as you said, the content is dynamic, so the widget doesn't know how high it should be at the point of insertion.
Muse 2017+ has the Boolean outputAsFixedHeight attribute (true by default). That might sort the issue.
Thank you so much! It was exactly that flag: outputAsFixedHeight
You saved my nervs
Can you please tell me where is this option? If I'm right, this will prevent inserted HTML codes from changing their heights, right? If yes, I hope, it'll just crop out the excess part from the HTML and not display scroll bars.
Thanks for the info!