react-numeric-input icon indicating copy to clipboard operation
react-numeric-input copied to clipboard

Incorrect behaviour on increase or decrease value in some cases

Open SkripalBoris opened this issue 7 years ago • 0 comments

For example we have some React component with NumericInput:

class Foo extends React.Component {
    constructor(props) {
        this.state = {
            value: 42
        }
    }

    _onInputChangeHandler = (newValue) => {
        // some business logic that processed more than 500ms
        this.setState({value: newValue});
    };

    render() {
        return (<NumericInput
                value={this.state.value}
                onChange={this._onInputChangeHandler}
            />);
    }
}

Expected Value change once

Actual After click on Increment button, input changes several times, because timer didn`t stop and step was called several times

SkripalBoris avatar Jul 24 '18 13:07 SkripalBoris