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

rc-input-number

Package Overview
Dependencies
Maintainers
7
Versions
218
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-input-number - npm Package Compare versions

Comparing version 7.0.0-alpha.2 to 7.0.0-alpha.3

2

es/hooks/useUpdateEffect.js

@@ -8,3 +8,3 @@ import * as React from 'react';

var initRef = React.useRef(false);
React.useEffect(function () {
React.useLayoutEffect(function () {
if (!initRef.current) {

@@ -11,0 +11,0 @@ initRef.current = true;

@@ -252,3 +252,3 @@ import _extends from "@babel/runtime/helpers/esm/extends";

setUncontrolledDecimalValue(updateValue);
onChange === null || onChange === void 0 ? void 0 : onChange(getDecimalValue(stringMode, updateValue)); // Reformat input if value is not controlled
onChange === null || onChange === void 0 ? void 0 : onChange(updateValue.isEmpty() ? null : getDecimalValue(stringMode, updateValue)); // Reformat input if value is not controlled

@@ -344,7 +344,5 @@ if (value === undefined) {

if (!parsedValue.isNaN()) {
// Only validate value can be re-fill to inputValue
if (!formatValue.isEmpty()) {
// Reassign the formatValue within ranged of trigger control
formatValue = triggerValueUpdate(parsedValue, true);
}
// Only validate value or empty value can be re-fill to inputValue
// Reassign the formatValue within ranged of trigger control
formatValue = triggerValueUpdate(parsedValue, true);
} else {

@@ -351,0 +349,0 @@ formatValue = decimalValue;

@@ -17,3 +17,3 @@ "use strict";

var initRef = React.useRef(false);
React.useEffect(function () {
React.useLayoutEffect(function () {
if (!initRef.current) {

@@ -20,0 +20,0 @@ initRef.current = true;

@@ -275,3 +275,3 @@ "use strict";

setUncontrolledDecimalValue(updateValue);
onChange === null || onChange === void 0 ? void 0 : onChange(getDecimalValue(stringMode, updateValue)); // Reformat input if value is not controlled
onChange === null || onChange === void 0 ? void 0 : onChange(updateValue.isEmpty() ? null : getDecimalValue(stringMode, updateValue)); // Reformat input if value is not controlled

@@ -367,7 +367,5 @@ if (value === undefined) {

if (!parsedValue.isNaN()) {
// Only validate value can be re-fill to inputValue
if (!formatValue.isEmpty()) {
// Reassign the formatValue within ranged of trigger control
formatValue = triggerValueUpdate(parsedValue, true);
}
// Only validate value or empty value can be re-fill to inputValue
// Reassign the formatValue within ranged of trigger control
formatValue = triggerValueUpdate(parsedValue, true);
} else {

@@ -374,0 +372,0 @@ formatValue = decimalValue;

{
"name": "rc-input-number",
"version": "7.0.0-alpha.2",
"version": "7.0.0-alpha.3",
"description": "React input-number component",

@@ -5,0 +5,0 @@ "keywords": [

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