Feature request: Auto-resize textarea

I’m making the suggestion here as well, as requested by Alan Cutter:


Which is to allow the following CSS to automatically change the height of a <textarea> depending on its content:

textarea {
    height: max-content;

This is related to the iframe resize and height animation requests:

Where I also have a working demo:


1 Like

I support adding something like this on textarea. It’s not clear to me that it should be a CSS feature though. I think an attribute on textarea would make more sense to me since this is really just trying to fix that textarea has some special sizing rules. I also think an attribute on textarea is more discoverable.

In either case, I don’t feel strongly about the color we paint the bikeshed, so I’d easily be swayed if other browser vendors felt differently or if there was a strong web developer sentiment for a particular solution.

It depends, while a <textarea> does have the rows/cols attributes, normally styling is done with CSS, that’s the only reason I think it falls under the CSS group.

The autoresize feature is purely presentational (e. g. doesn’t make sense for voice browsers), so it’s certainly of CSS responsibility.