The CSSWG adopted a new CSS form-sizing property
It aims to solve the age-old frustration of running out of room when typing in a <textarea>
element. We can already set the number of rows in a <textarea>
directly in HTML:
<textarea rows="10">
Setting the initial size isn’t the issue, but what happens after the user has reached that threshold. It’s at that point where any text entered into the element that goes beyond that 10 rows starts cutting off text at the top.
We might go so far as to consider this to be a form of CSS data loss.
That’s what the proposal for a new form-sizing
property is all about, which the CSSWG approved back on May 10, 2023. The idea is that we can opt into textareas that are automatically sized by the content they contain:
/* Adjust sizing to content */
textarea { form-sizing: auto; }
/* Normal behavior */
textarea { form-sizing: normal; }
Chrome appears to be the only browser currently working on the new property, at least in Chrome Canary. There’s a quiet ticket in Firefox, and nada that I could find in WebKit. Does that mean I’m obligated to file it?