A fixed-height text area can hide most of a long message behind a small scrolling window. CSS now offers a way for supported form controls to size themselves around their contents: field-sizing. It can reduce the amount of custom resizing code needed for a straightforward form.
MDN’s field-sizing reference describes the content value and its effect on text controls. Browser support has improved, but older browsers still need a usable default. Treat the feature as an enhancement rather than the only way to make the field operable.
textarea {
box-sizing: border-box;
width: 100%;
min-height: 8rem;
max-height: 24rem;
overflow: auto;
}
@supports (field-sizing: content) {
textarea {
field-sizing: content;
}
}
This example keeps the width constrained, gives an empty field a reasonable minimum and limits how far it can grow. Once content exceeds the maximum, the user still needs a way to scroll within the field. The dimensions are illustrative design choices, not universal accessibility requirements.
Test the change with real editing actions
Type a short message, paste several paragraphs and then delete most of the text. Check what happens to the field, nearby buttons and the page scroll position. Repeat at a narrow viewport and with enlarged text.
Use a proper visible label. A placeholder can affect intrinsic sizing, but it should not be the only explanation of the field’s purpose. Error messages and help text need to remain understandable when the field changes height.
Also test a browser without the feature. The fallback should still allow a message to be entered and reviewed. Do not remove useful manual resizing or scrolling merely because the latest browser grows the control automatically.
The design benefit is modest and concrete: more of the user’s writing can remain visible while they edit. Sensible limits keep that benefit from turning a long paste into a form that pushes every other control far down the page.

