New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

smart-number-inputs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smart-number-inputs

Increment/decrement number values in text inputs using up and down arrow keys.

1.1.2
latest
Source
npm
Version published
Weekly downloads
8
Maintainers
1
Weekly downloads
 
Created
Source

smart-number-inputs

Build Status

Increment/decrement number values in text inputs using up and down arrow keys.

Demo | NPM

Demo

Usage

Vanilla API:

smartNumberInputs.enable(DOMElement element);
smartNumberInputs.enable(DOMElement[] elements);
smartNumberInputs.enable(NodeList elements);
smartNumberInputs.enable(HTMLCollection elements);

Manually attaching the event handler to affect dynamically created inputs using jQuery:

$(document).on('keydown', 'input', smartNumberInputs.eventHandler);

NPM:

const smartNumberInputs = require('smart-number-inputs');

Running tests

npm test

Only unit tests:

npm run test:unit

Only browser tests:

npm run test:browser

Building

npm run build

Browser support

Sauce Test Status

Modern browsers.

Utilizes addEventListener (if using smartNumberInputs.enable) and DOMElement.setSelectionRange. Both of these can be polyfilled if support for ancient browsers is desired.

Credits

Built by @codeclown to be used in MailDeveloper.

Browser testing provided for free by Sauce Labs. Thanks!

License

MIT

FAQs

Package last updated on 14 Feb 2018

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