Note that there are some explanatory texts on larger screens.

plurals
  1. POIOS browser don't shrink page content once scrolled
    primarykey
    data
    text
    <p>Edited:[All the following happens even on stock IOS browser]</p> <p>I have a UiWebView which load a local HTML page. The content of the page is managed dinamically by JS, so it may grow or shrink vertically.</p> <p>The layout is:</p> <pre><code>&lt;div id="myContainer"&gt; Some text here &lt;/div&gt; </code></pre> <p>The text-content may grow up to require vertical scroll, and everything is working fine. </p> <p>Whenever i load new content, I use:</p> <pre><code>container.innerHTML = ''; container.appendChild(newContent); </code></pre> <p>Again, everything is fine.</p> <p>The problem came when i scroll the page vertically: if I load a big content, the scroll is managed correctly, but then I load a small content and the page keeps the same big size set by the big content, with a lot of unused blank space at the end.</p> <p>If i don't ever try to scroll the page vertically, the problem don't shows up (eg. i load the big content, I don't scroll, then I load the small content => the scroll is fine and page is shrinked to the latter). That's quite weird, I think something may be broken in the ScrollView logic or in the Webkit engine.</p> <p>I already tried by using timeouts between <em>innerHTML = ''</em> and <em>appendChild</em>. No luck here.</p> <p>I'm experiencing this problem just on IOS stock browser &amp; UiWebView, not on any desktop browser nor Android mobile browser / WebView.</p> <p>Could anyone help?</p> <p>Thanks</p> <p>Edit: Reloading the UiWebView by browsing a blank URL or anything else is not an applicable way in this case: my app is fully JS and I definitely cannot restart the app each time.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload