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

input-number

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

input-number - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

30

index.js

@@ -11,3 +11,4 @@ /**

38: 'up',
40: 'down'
40: 'down',
13: 'enter'
};

@@ -27,3 +28,7 @@ const numRE = /[\-\.0-9]/;

input.removeEventListener('keydown', input._inputNumber)
if (input._inputNumber) {
input.removeEventListener('keydown', input._inputNumber)
input.removeEventListener('blur', input._inputNumber.change)
}
input.addEventListener('keydown', keydown)

@@ -36,2 +41,8 @@

if (key === 'enter') {
let changeEvent = new Event('change');
input.dispatchEvent(changeEvent);
return;
}
e.preventDefault();

@@ -88,14 +99,17 @@

focused = true;
input.addEventListener('blur', function change () {
input.removeEventListener('blur', change);
let changeEvent = new Event('change');
input.dispatchEvent(changeEvent);
focused = false;
});
input.addEventListener('blur', change);
}
}
keydown.change = change
function change () {
input.removeEventListener('blur', change);
let changeEvent = new Event('change');
input.dispatchEvent(changeEvent);
focused = false;
}
input._inputNumber = keydown
return input;
}
{
"name": "input-number",
"version": "1.1.0",
"version": "1.1.1",
"description": "Make input recognize numbers",

@@ -27,3 +27,3 @@ "main": "index.js",

"dependencies": {
"caret-position2": "^1.0.2",
"caret-position2": "^1.0.3",
"mumath": "^2.3.0"

@@ -30,0 +30,0 @@ },

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