Grow textareas. Will work with any input, including long lines that don't have spaces.
<textarea id="content"></textarea>
grow(content)
$ component install matthewmueller/grow
This technique copies the textarea value to a "shadow" div to compute the proper height then updates the textarea.
Loosely based off of https://github.com/jaz303/jquery-grab-bag/blob/master/javascripts/jquery.autogrow-textarea.js
Note: Use
component/grow
if you only need your textarea to grow from newlines.
Initializes a growing textarea. Options include
buffer
: sets the amount of buffer space added to the end. Defaults to 20px.
- remove jquery dependency (needs a component that gets the computed style)
MIT