Categories
TITGIG

Bugfix – erratically expanding textareas, no thanks!

Ade discovered an undesirable behaviour when writing a comment on this site, which I believe is probably also present in the WordPress classic theme.

The main text field for entering comments in was being created using the following HTML:

<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>

As a result of a bug in Internet Explorer, as soon as you start typing in this text field it will expand to the width of the browser window, leaving the right-hand edge hidden underneath the sidebar. The culprit is cols="100%".

To fix it, I added a couple of lines, so the HTML now reads:

<div style="width:100%">
<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
</div>

This seems to fix the oddness in IE without affecting the rendering in Firefox. Let me know if you encounter any further peculiarities.

One reply on “Bugfix – erratically expanding textareas, no thanks!”

Leave a Reply

Your email address will not be published. Required fields are marked *