react-polymorph
Advanced tools
Comparing version 0.9.0-rc.11 to 0.9.0-rc.12
@@ -180,2 +180,3 @@ 'use strict'; | ||
var isDeletion = isForwardDelete || isBackwardDelete; | ||
var isInsert = inputType === 'insertText'; | ||
var deleteCaretCorrection = isBackwardDelete ? 0 : 1; | ||
@@ -273,5 +274,6 @@ var validInputRegex = allowSigns ? VALID_INPUT_SIGNS_REGEX : VALID_INPUT_NO_SIGNS_REGEX; | ||
if (newValue.charAt(0) === '.') { | ||
var newCaretPos = isInsert ? 2 : 1; | ||
return { | ||
value: newNumber, | ||
caretPosition: 2, | ||
caretPosition: newCaretPos, | ||
minimumFractionDigits: dynamicMinimumFractionDigits | ||
@@ -308,3 +310,2 @@ }; | ||
// Case: Dot was deleted with minimum fraction digits constrain defined | ||
var isInsert = inputType === 'insertText'; | ||
var hasFractions = this.getMinimumFractionDigitsProp() != null; | ||
@@ -311,0 +312,0 @@ var wasDotRemoved = hadDotBefore && !newNumberOfDots; |
{ | ||
"name": "react-polymorph", | ||
"description": "React components with highly customizable logic, markup and styles.", | ||
"version": "0.9.0-rc.11", | ||
"version": "0.9.0-rc.12", | ||
"scripts": { | ||
@@ -6,0 +6,0 @@ "build": "cross-env npm run clean && npm run sass && npm run js", |
@@ -152,2 +152,3 @@ // @flow | ||
const isDeletion = isForwardDelete || isBackwardDelete; | ||
const isInsert = inputType === 'insertText'; | ||
const deleteCaretCorrection = isBackwardDelete ? 0 : 1; | ||
@@ -252,5 +253,6 @@ const validInputRegex = allowSigns ? VALID_INPUT_SIGNS_REGEX : VALID_INPUT_NO_SIGNS_REGEX; | ||
if (newValue.charAt(0) === '.') { | ||
const newCaretPos = isInsert ? 2 : 1; | ||
return { | ||
value: newNumber, | ||
caretPosition: 2, | ||
caretPosition: newCaretPos, | ||
minimumFractionDigits: dynamicMinimumFractionDigits, | ||
@@ -287,3 +289,2 @@ }; | ||
// Case: Dot was deleted with minimum fraction digits constrain defined | ||
const isInsert = inputType === 'insertText'; | ||
const hasFractions = this.getMinimumFractionDigitsProp() != null; | ||
@@ -290,0 +291,0 @@ const wasDotRemoved = hadDotBefore && !newNumberOfDots; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1636340
11008