A little while back, while noting that CSS is slated to solve the “auto-expanding <textarea>“ thing, I also briefly explained my favorite current solution.
Simon Willison had a look and did a much deeper explanation of it, if you’re into such things.
There is a little bummer with the technique β there’s…
… a frustrating intermittent bug in Mobile Safari: sometimes the effect works, and sometimes it doesn’t.
I seem to remember seeing this in the past (in Mobile Safari). But I’ve been trying to replicate it today to see if I could be helpful, and I just can’t get it to happen (17.0.3). I’m not saying it’s fixed, I just can’t seem to re-create the bug, even doing what Simon suggested in clicking over from Twitter in the in-app browser to a demo.
Simon documented the bug in case you want to see video of what was happening.
I bring it up because it seems like a rather exceptional bug to me.
First, it’s intermittent. Intermittent bugs are the worst. Sometimes they happen, sometimes they don’t, and it’s not clear why. Usually, intermittent bugs suggest the network is involved, which is notorious for intermittent error. But there is nothing network or network-like here.
Second, this is just simple direct web standards code. A little bit of HTML, CSS, and JavaScript. No dependencies, no time zones, no alternate languages or unusual unicode, nothing even slightly out of the norm.
Isn’t that strangeβ½
It’s like if you had <div>text</div> on a page and once in every 1,000 time you refreshed, the text was red.