diff --git a/src/NumericInput.jsx b/src/NumericInput.jsx index 93d4e7c..168a039 100644 --- a/src/NumericInput.jsx +++ b/src/NumericInput.jsx @@ -543,6 +543,11 @@ class NumericInput extends Component */ _parse(x: string): number { + // prevent backspace on dot in float value + if (this.props.precision > 0 && this.state.value !== null && !isNaN(this.state.value) && x.length > 0 && x.indexOf(".") < 0) { + x = this.state.value; + } + if (typeof this.props.parse == 'function') { return parseFloat(this.props.parse(x)); }