Autosizes textarea to size of it's contents.
Перейти к файлу
Jon Rohan 715ab5d365
Merge pull request #42 from github/dependabot/npm_and_yarn/braces-3.0.3
Bump braces from 3.0.2 to 3.0.3
2024-06-18 16:52:34 -07:00
.github/workflows Create .github/workflows/publish.yml 2022-03-25 15:53:42 +00:00
examples use unpkg over jsdelivr 2021-03-09 15:17:40 +00:00
src Update src/index.js 2023-11-30 13:25:27 -08:00
.eslintrc.json Update eslint and related dependencies 2021-03-11 10:42:09 +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
CODEOWNERS move AOR to primer 2022-09-23 17:53:17 +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 Bump braces from 3.0.2 to 3.0.3 2024-06-16 10:10:02 +00:00
package.json 0.3.0 2022-08-19 14:07:32 +02:00
tsconfig.json output ES5 compatible code. 2019-11-13 11:49:39 +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.