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

react-time-picker

Package Overview
Dependencies
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-time-picker - npm Package Compare versions

Comparing version 4.4.3 to 4.4.4

14

dist/TimeInput/Input.js

@@ -30,2 +30,3 @@ "use strict";

var isIEOrEdgeLegacy = typeof window !== 'undefined' && /(MSIE|Trident\/|Edge\/)/.test(window.navigator.userAgent);
var isFirefox = typeof window !== 'undefined' && /Firefox/.test(window.navigator.userAgent);

@@ -90,13 +91,16 @@ function onFocus(event) {

return function onKeyPress(event) {
if (isFirefox) {
// See https://github.com/wojtekmaj/react-time-picker/issues/92
return;
}
var key = event.key,
input = event.target;
var value = input.value;
var isNumberKey = !isNaN(parseInt(key, 10));
var isNumberKey = key.length === 1 && /\d/.test(key);
var selection = getSelectionString(input);
if (isNumberKey && (selection || value.length < maxLength)) {
return;
if (!isNumberKey || !(selection || value.length < maxLength)) {
event.preventDefault();
}
event.preventDefault();
};

@@ -103,0 +107,0 @@ }

{
"name": "react-time-picker",
"version": "4.4.3",
"version": "4.4.4",
"description": "A time picker for your React app.",

@@ -73,3 +73,4 @@ "main": "dist/entry.js",

},
"funding": "https://github.com/wojtekmaj/react-time-picker?sponsor=1"
"funding": "https://github.com/wojtekmaj/react-time-picker?sponsor=1",
"packageManager": "yarn@3.1.0"
}

@@ -16,2 +16,7 @@ import React from 'react';

const isFirefox = (
typeof window !== 'undefined'
&& /Firefox/.test(window.navigator.userAgent)
);
function onFocus(event) {

@@ -73,13 +78,16 @@ const { target } = event;

return function onKeyPress(event) {
if (isFirefox) {
// See https://github.com/wojtekmaj/react-time-picker/issues/92
return;
}
const { key, target: input } = event;
const { value } = input;
const isNumberKey = !isNaN(parseInt(key, 10));
const isNumberKey = key.length === 1 && /\d/.test(key);
const selection = getSelectionString(input);
if (isNumberKey && (selection || value.length < maxLength)) {
return;
if (!isNumberKey || !(selection || value.length < maxLength)) {
event.preventDefault();
}
event.preventDefault();
};

@@ -86,0 +94,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