Note that there are some explanatory texts on larger screens.

plurals
  1. POneeded a way to force redraw of <select>s in MSIE8
    primarykey
    data
    text
    <p>with (simulated) media queries I'm changing font-size of <code>&lt;select&gt;</code>s in my page</p> <p>I have problems with other browsers too, but I resolved temporarily detaching the elements from DOM and re-attaching them after a small amount of time</p> <p>but with MSIE8 I still have problems with height of <code>&lt;option&gt;</code>s which is equal to the max fontSize set, even if it's not applied anymore</p> <p><a href="http://fiddle.jshell.net/U3bzT/show/light/" rel="nofollow noreferrer">http://fiddle.jshell.net/U3bzT/show/light/</a></p> <p><img src="https://i.stack.imgur.com/2FmBz.png" alt=""> <img src="https://i.stack.imgur.com/xXBo3.png" alt=""></p> <p>expected result:</p> <p><img src="https://i.imgur.com/25ES1Qb.png" alt=""></p> <p>the <code>font-size</code> is updated while switching from a bigger font size to a smaller one</p> <p><strong>but not the line-height/height of <code>&lt;option&gt;</code>s</strong></p> <p>happens to both select-multiple and select-one</p> <p>how can I fix this?</p> <p><strong>Note:</strong> <code>&lt;select&gt;</code>s may have events attached, so <strong>I can't use a copy</strong></p> <pre><code>&lt;script&gt; // just some code to simulate media query on/off state var select; setTimeout(function(){ select = document.getElementsByTagName("select")[0]; select.style.fontSize='40px'; webkitFix(); setTimeout(function(){ select.style.fontSize='10px'; webkitFix(); },5000); },5000); function webkitFix(){ document.body.removeChild(select); setTimeout(function(){ document.body.appendChild(select); }, 1); } &lt;/script&gt; &lt;select multiple size="6" style="font-size:10px"&gt; &lt;option&gt;AAAAAA1&lt;/option&gt; &lt;option&gt;BBBBBB2&lt;/option&gt; &lt;option&gt;AAAAAA3&lt;/option&gt; &lt;option&gt;BBBBBB4&lt;/option&gt; &lt;option&gt;AAAAAA5&lt;/option&gt; &lt;option&gt;BBBBBB6&lt;/option&gt; &lt;option&gt;AAAAAA7&lt;/option&gt; &lt;option&gt;BBBBBB8&lt;/option&gt; &lt;option&gt;AAAAAA9&lt;/option&gt; &lt;/select&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
 

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