I'm sure there's an answer to this question somewhere on SO, but after some time of looking, I was unable to find one.
What I'm trying to do is create a <textarea>
element that the user CANNOT manually resize (there won't be a dragable resize item in the bottom-right corner for the user to resize with), but still the <textarea>
element will automatically resize when the text flows to a new line.
What I've tried is using resize: none
, and while that eliminates manual resizing, it also removes automatic resizing when the content of the textarea goes too far within the space provided.
To be clear, I do not want there to be a scroll bar when the text overflows the size of the <textarea>
. I would like for the element to get larger to accommodate the additional text.
Here's an example of what I've tried:
textarea {
resize: none;
}
<textarea></textarea>
As you can see, it removes manual resizing, but also removes automatic resizing.