React textarea component to automatically expand and contract your textareas.
You can view the demo here.
Install the package via NPM:
$ npm install --save react-expanding-textarea
Use this exactly like you would a normal <textarea>
; the only
difference is that it is doing some simple expanding work behind the scenes for you!
import Textarea from 'react-expanding-textarea'
function handleChange(e) {
console.log('Changed value to: ', e.target.value)
}
const myComponent = () =>
<Textarea
rows="1"
maxLength="3000"
className="textarea"
name="post[notes]"
placeholder="Notes"
onChange={ handleChange } />
- Make your changes to
src/ExpandingTextarea.js
and/orexample/src
and/orexample/sass
- Run make to build the JS output as well as the example code
- Run
$ open example/index.html
to view the output
- Check out the issues
- Fork this repository
- Clone your fork
- Check out a feature branch (
$ git checkout -b my-feature
) - Make your changes and push your branch to your GitHub repo
- Create a pull request from your branch to this repo's master
- When all is merged, pull down the upstream changes to your master
- Delete your feature branch