Autosizes textarea to size of its contents.
$ npm install @github/textarea-autosize
The autosizing behavior must be explicitly activated on the <textarea>
.
import autosize from '@github/textarea-autosize'
autosize(document.querySelector('textarea.foo'))
Using a library like selector-observer, the behavior can automatically be applied to any textareas matching a class name.
import {observe} from 'selector-observer'
import autosize from '@github/textarea-autosize'
observe('textarea.autosize', { subscribe: autosize })
- Chrome
- Firefox
- Safari
- Internet Explorer 11
- Microsoft Edge
npm install
npm test
Distributed under the MIT license. See LICENSE for details.