1.5.4 • Published 6 years ago

riot-autoresize v1.5.4

Weekly downloads
69
License
MIT
Repository
github
Last release
6 years ago

riot-autoresize

This mixin will make textareas autoresize. So when you type/paste a bunch of text they will grow automatically, and shrink back down when you delete it.

It's very lightweight and does just what it says.

Installation

$ npm install riot-autoresize

Or:

yarn add riot-autoresize

Usage

Add the mixin to your application and get the party started:

import autoresize from 'riot-autoresize'

// mount it globally (used by all tags automatically)
riot.mixin(autoresize)

// or use a shared mixin (preferred)
riot.mixin('autoresize', autoresize)

// Then mount app here using riot.mount
<my-tag>
  <textarea autoresize></textarea>

  // you only need this if you used a shared mixin
  this.mixin('autoresize')
</my-tag>

I also recommend using rows="1" in the textarea, and making styling changes via CSS such as min-height.

Notes

Because this is written in ES2015, but transpiled automatically by Babel. If you want to use the raw source you may need to transpile your application using Buble or Babel.

1.5.4

6 years ago

1.5.2

6 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago