react-polymorph
Advanced tools
Comparing version 0.2.5 to 0.2.6
Changelog | ||
========= | ||
## 0.2.6 | ||
### Fixes | ||
- Fixed a bug in `NumericInput` when illegal chars have been entered but the | ||
old valid value was still `null`. | ||
## 0.2.5 | ||
@@ -5,0 +12,0 @@ |
@@ -123,2 +123,3 @@ 'use strict'; | ||
var handledValue = void 0; | ||
var lastValidValue = this.state.oldValue; | ||
if (!isValueRegular && value !== '') { | ||
@@ -128,3 +129,3 @@ // input contains invalid value | ||
// - reject it and show last valid value | ||
handledValue = this.state.oldValue; | ||
handledValue = lastValidValue ? lastValidValue : '0.000000'; | ||
position = position - 1; | ||
@@ -138,3 +139,3 @@ } else if (!this._isNumeric(value)) { | ||
// input value contains more than one dot | ||
var splitedOldValue = this.state.oldValue.split('.'); | ||
var splitedOldValue = lastValidValue.split('.'); | ||
if (splitedOldValue[0].length <= splitedValue[0].length) { | ||
@@ -148,3 +149,3 @@ // dot is in decimal part | ||
if (beforeDot.length > this.props.maxBeforeDot) { | ||
handledValue = this.state.oldValue; | ||
handledValue = lastValidValue; | ||
} | ||
@@ -162,3 +163,3 @@ } else { | ||
// - reject it and show last valid value | ||
handledValue = this.state.oldValue; | ||
handledValue = lastValidValue; | ||
} | ||
@@ -165,0 +166,0 @@ } |
{ | ||
"name": "react-polymorph", | ||
"description": "React components with highly customizable logic, markup and styles.", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Dominik Guzei", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
228596
1103
0