@stormid/textarea

1.0.0-alpha.6 • Public • Published

Textarea

Auto-resizing textarea


Usage

Install the package

npm i -S @stormid/textarea

Import the module

import textarea from '@stormid/textarea';

Initialise the module via selector string

const [ instance ] = boilerplate('.js-boilerplate');

Initialise with a DOM element

const element = document.querySelector('textarea');
const [ instance ] = textarea(element);

Initialise with a Node list

const elements = document.querySelectorAll('textarea');
const [ instance ] = textarea(elements);

Initialise with an Array of elements

const elements = [].slice.call(document.querySelectorAll('textarea'));
const [ instance ] = textarea(elements);

Options

{
    events: [
        'input' //default textarea resize event
    ]
}

API

textarea() returns an array of instances. Each instance exposes the interface

{
    node, DOMElement, the text area
    resize, Function to trigger resize
}

Tests

npm t

License

MIT

Package Sidebar

Install

npm i @stormid/textarea

Weekly Downloads

0

Version

1.0.0-alpha.6

License

MIT

Unpacked Size

18.1 kB

Total Files

11

Last publish

Collaborators

  • sarah-storm
  • mjbp
  • stormid-admin
  • lynchjames