@github/textarea-autosize
TypeScript icon, indicating that this package has built-in type declarations

0.3.3 • Public • Published

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.3.3
    13
    • latest

Version History

Package Sidebar

Install

npm i @github/textarea-autosize

Weekly Downloads

1,616

Version

0.3.3

License

MIT

Unpacked Size

11.3 kB

Total Files

7

Last publish

Collaborators

  • andrialexandrou
  • jfuchs
  • githubbot
  • manuelpuyol
  • jonrohan
  • broccolini
  • primer-css
  • keithamus
  • mschoening
  • colebemis
  • smockle
  • simurai
  • khiga8
  • dustin.greif
  • srt32