@github/textarea-autosize

Autosizes textarea to size of it's contents.

Stats

StarsIssuesVersionUpdatedCreatedSize
@github/textarea-autosize
5320.2.26 months ago3 years agoMinified + gzip package size for @github/textarea-autosize in KB

Readme

Textarea Autosize

Autosizes textarea to size of its contents.

Installation

$ npm install @github/textarea-autosize

Usage

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 })

Browser support

  • Chrome
  • Firefox
  • Safari
  • Internet Explorer 11
  • Microsoft Edge

Development

npm install
npm test

License

Distributed under the MIT license. See LICENSE for details.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.