This Riot.js mixin will auto resize all textareas with the "autoresize" property.
npm install riot-autoresizeThis 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.
``bash`
$ npm install riot-autoresize
Or:
`bash`
yarn add riot-autoresize
Add the mixin to your application and get the party started:
`javascript
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
`
`javascript
// you only need this if you used a shared mixin
this.mixin('autoresize')
`
I also recommend using rows="1" in the textarea, and making styling changes via CSS such as min-height`.
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.