No description
  • JavaScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-05-14 13:49:19 -07:00
.github/workflows Update publish.yml 2026-05-08 13:17:13 -07: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
package-lock.json Bump lodash in the npm_and_yarn group across 1 directory 2026-04-02 15:36:17 +00:00
package.json 0.3.0 2022-08-19 14:07:32 +02:00
README.md Add missing import 2018-08-28 10:59:52 -07:00
tsconfig.json output ES5 compatible code. 2019-11-13 11:49:39 +00:00

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.