Currently, I am facing an issue with an SVG that has a CSS width of 100% and height of 100%. The wrapping element spans the entire width of the screen while its height is set to auto. It's important to note that the wrap div determines the dimensions of the SVG.
Here is an example setup:
<div id="svg-wrap" style="width: 100%; height: auto;">
<svg style="width: 100%; height: 100%;"></svg>
</div>
The problem arises when I load the page with these elements hidden (display: none). This seems to disrupt the height calculation when the elements are displayed after the DOM is ready. As a result, the dimensions of the SVG can get skewed, turning into something like 1024px wide x 25px high instead of the expected 500px high.
My assumption is that hiding objects prevents proper width calculations, impacting auto heights in the process. Is there something I'm missing here? What would be the workaround for this situation?