ionic2-autosize
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

ionic2-autosize

ionic2-autosize is an Ionic2 / Angular2 directive that automatically adjusts textarea height to fit content.

It adjusts the textarea height automatically to any text input, or changes to the model bound to the textarea.

Acknowledgements

This code based on Steve Papa's angular2-autosize solution

Installation:

npm install ionic2-autosize

Use Example:

import {Component} from '@angular/core';
import {Autosize} from 'ionic2-autosize';
 
@Component({
  template: `
    <ion-textarea autosize>
        "The time has come," the Walrus said,
        "To talk of many things:
        Of shoes--and ships--and sealing-wax--
        Of cabbages--and kings--
        And why the sea is boiling hot--
        And whether pigs have wings."
 
        "But wait a bit," the Oysters cried,
        "Before we have our squall;
        For some of us are out of breath,
        And all of us are tall!"
        "No hurry!" said the Carpenter.
        They thanked him much for all.
    </ion-textarea>
  `,
  directives: [Autosize]
})
 
class App {
 
}

Authors

Zeb Burke-Conte & Felix

Licence

This project is licensed under the MIT license. See the LICENSE file for more info.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i ionic2-autosize

      Weekly Downloads

      2

      Version

      1.1.2

      License

      MIT

      Last publish

      Collaborators

      • felixl