A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

Feature request: Auto-resize textarea

craig.francis
2016-03-22

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

https://crbug.com/596326

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:

https://craigfrancis.github.io/iframe-height/additional/textarea/

ojanvafai
2016-03-22

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.

craig.francis
2016-03-22

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.

MT
2016-03-24

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