Autosizes textarea to size of it's contents.
Перейти к файлу
Kristján Oddsson 9e7cbb61c3
compile source to UMD as well
Co-Authored-By: Keith Cirkel <keithamus@users.noreply.github.com>
2019-11-13 11:19:59 +00:00
.github/workflows use GitHub CI 2019-08-29 15:19:52 +01:00
examples replace the babel compiler with the typscript compiler 2019-11-06 17:02:17 +00:00
src rename file to index.js 2019-11-07 10:52:37 +00:00
.eslintrc.json newline 2019-11-07 10:46:38 +00:00
.gitignore Lock files are required in source control 2019-11-05 17:07:54 -07:00
.travis.yml add travis config file 2019-09-04 14:24:21 +01:00
LICENSE Initial commit 2018-08-08 15:02:33 -07:00
README.md Add missing import 2018-08-28 10:59:52 -07:00
package-lock.json update eslint-plugin-github to it's latest version 2019-11-07 10:47:46 +00:00
package.json compile source to UMD as well 2019-11-13 11:19:59 +00:00
prettier.config.js Initial commit 2018-08-08 15:02:33 -07:00
tsconfig.json rename file to index.js 2019-11-07 10:52:37 +00:00

README.md

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.