This is a javascript plugin to have the ability for a textarea to automatically grow and shrink dynamically with its content.
Quick Start with GIT with Documentation
git clone https://github.com/RidwanulHafiz/grow.js.git
- Install with NPM
npm install textarea-auto-grow-ridwan
HTML component
<textarea data-grow="auto"></textarea>
Import grow.js
inside </head>
section
<script src="/path/grow.js"></script>
Then call it when document is ready. It will automatically call with default options when document is ready. if you want to call it with custom option then call it after document ready.
document.addEventListener('DOMContentLoaded', function(){
var option = {
height : 100,
maxHeight : 500
};
AutoGrow.init(option);
}, false);
HTML component
<textarea data-grow="auto"></textarea>
Import package into component
import grow from 'textarea-auto-grow-ridwan'
Then call it when component is ready.
var option = {
height : 100,
maxHeight : 500
};
grow.init(option);