Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

input-autogrow

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

input-autogrow

jQuery autogrow plugin for inputs

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
278
decreased by-18.95%
Maintainers
1
Weekly downloads
 
Created
Source

input-autogrow

Buy Me a Coffee

input-autogrow is a jQuery plugin for autogrowing inputs. This plugin is different from others because most usually target textarea tags, this library is instead targeted at input tags.

Install

Yarn, NPM, or Bower
yarn add chosen-material-theme

npm install chosen-material-theme

bower install chosen-material-theme
Rails Install
# Gemfile
source 'https://rails-assets.org' do
  gem 'rails-assets-input-autogrow'
end


# app/assets/javascripts/application.js
/*
 *= require input-autogrow
*/

Usage

/* Makes elements readonly if they already have the readonly attribute */
$('input.autogrow').inputAutogrow();

/* Manually trigger update */
$('input.autogrow').trigger('autogrow');
/* or */
$('input.autogrow').trigger('change');

/* Update Autogrow field with updated parent container width */
$('input.autogrow').inputAutogrow();

/* Custom Options */
$('input.autogrow').inputAutogrow({maxWidth: 500, minWidth: 25, trailingSpace: 10});

/* Remove autogrow from input */
$('input.autogrow').inputAutogrow('destroy');

Options

maxWidth - Default: Inputs parent width - The max width of the autogrow

minWidth - Default: Original input start width - The min width of the autogrow.

trailingSpace - Default: 0 - This is extra spacing at the end of the input which is used until the maxWidth is hit.

Credits

Created by Weston Ganger - @westonganger

This plugin is based on a Stackoverflow answer by James Padolsey

Keywords

FAQs

Package last updated on 25 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc