Notice how it disappears when you start typing into the box.Get the latest and greatest from MDN delivered straight to your inbox.The newsletter is offered in English only at the moment. The idea. Hi there, I am making an app that require a textarea that is pretty height (almost the height of the view). While using this site, you agree to have read and accepted our The Element.scrollHeight read-only property is a measurement of the height of an element's content, including content not visible on the screen due to overflow.. The scrollHeight value is equal to the minimum height the element would require in order to fit all the content in the viewport without using a vertical scrollbar. I assume you want to fit it into the text area without wrapping (with wrapping, this is a different problem, also solvable, but this is not what you are asking about, because it would take width on input and produce required height on output, so we need to assume no-wrapping solution).

A protip by moak about jquery, ux, userexperience, textarea, and html.

The height of the textarea will either grow or shrink to fit the content (grow to a maximum of max-rows or shrink to a minimum of rows).. To set the initial minimum height (in rows), set the rows prop to the desired number of lines (or … element.scrollHeight gives us the height of the content, regardless of visible scrollbars.

Why painful? But unfortunately there is no auto-height property.

Also see the

tag.. then, trying to scroll down to the last line of the textarea is very difficult … Bootstrap textarea is an input dedicated for a large volume of text.

Note: The size of a textarea can also be specified by the CSS height and ... references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. So, here is the conclusion: you have some text. Examples might be simplified to improve reading and basic understanding.

Luckily there's a quick CSS solution to this problem! It may be used in a variety of components like forms, comment sections, and forums. v-textarea's have the option to remain the same size regardless of their content's size, using the no-resize prop.

I have some problem with that: when focusing on the last line of my textarea (let’s say the textarea is full of text) and start edit, the view scroll automatically back to the top of the textarea. If you need any additional help, use our "5 min Quick Start" guide or start full Bootstrap tutorial.

W3Schools is optimized for learning, testing, and training. The HTML