field-sizing: content
A textarea that grows as you type
CaveatGive it a max-height, or a pasted wall of text pushes the submit button off screen — worse than the scrollbar you were removing. lh units keep the bounds in lines, not guessed pixels.
FallbackChromium has had this since 123. Where it is ignored you get a plain textarea at whatever rows says, so set rows to the height you would have shipped anyway.
<textarea rows="2"></textarea>
textarea {
field-sizing: content;
min-height: 3lh;
/* or it eats the page */
max-height: 9lh;
resize: none;
}
Published