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

react-input-just-numbers

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-input-just-numbers

React Form Input Number with Support for Mobile Devices.

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

react-input-just-numbers

React Input Just Numbers is a Hack to fix the issues with HTML Form Input type=number in Mobile and Desktops.

It eliminates the issue of accidentally changing numeric values when a user scroll's over the focused input as well as changing values with Up and Down Keys(In Desktop). It opens a Numeric Keypad in Both Android and IOS Devices. It Gives you an option of choosing just numeric keypad (just the digits, no .(dot) character) for IOS using 'onlydigits' attribute. Android has a .(dot) in its default Numeric Keypad.

Installation

$ npm install react-input-just-numbers  --save

Usage

Import it in your Component


import InputNumber from 'react-input-just-numbers';

Use it like a normal Form Component, add attributes and events as you would have added normally in an input[type="number"] field in React.

<form>
...
<InputNumber placeholder="Your Placeholder Text" value={someDefaultValue}
            onChange={(e) => someFunctionName(e)}
            />
...
</form>

Options

Add 'onlydigits' attribute to enable Numeric Keypad in Apple IOS Devices, Android opens it by default.

<InputNumber onlydigits placeholder="Your Placeholder Text" value={someDefaultValue}
            onChange={(e) => someFunctionName()}
            />

License

MIT | © Ayushya Jaiswal

Keywords

FAQs

Package last updated on 07 Dec 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

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