react-number-format icon indicating copy to clipboard operation
react-number-format copied to clipboard

decimalScale value is not removing when we press backspace key using keyboard

Open PankajK-HnH opened this issue 4 years ago • 1 comments

I am using this package in our react js project for input number fields. my requirement is when the user type any number then automatically two decimal zeros are added after the number. this is working perfect but the issue is that when the user wants to remove the two decimal zero using the backspace key they are not able to remove, only cursor position is moving.

Provide steps to reproduce this issue

1> add decimalscale(2) to any input tag 2> enter any value ex- 12, then decimalscale added .00 after this value 3> value showing in input box right now is 12.00, now press backspace using keyboard the two decimal zero value is not removing from the input box.

my code--

<NumberFormat customInput={TextValidator} label="% of presence*" name="keyPersonnelPercentage" value={this.props.state.keypersonalpercentage} validators={["required"]} errorMessages={["This field is required"]} withRequiredValidator={true} className="form-control" onChange={this.props.percenatgechange} validatorListener={this.props.validatorListener} decimalScale={2} isAllowed={this.props.limitNumber} fixedDecimalScale />

PankajK-HnH avatar Aug 12 '21 08:08 PankajK-HnH

same problem

fruitbang avatar Jun 20 '23 20:06 fruitbang