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

Not compatible with React 16.4?

Open wmertens opened this issue 7 years ago • 1 comments

When I click on up/down, it doesn't change the value. I need to hold it for longer before it works.

I traced the onClick and I see that on a single click, increase calls _step which calls this.setState without a callback defined, and then increase immediately reads this.state. However, the state hasn't yet changed by then, because setState can be asynchronous.

To solve this, I propose that _step returns the new value and the caller is responsible for calling setState.

wmertens avatar Jul 23 '18 14:07 wmertens

Actually, it seems to be something different, because the this.state.value test is only used to know if it should add the repeat function.

So, no idea what's going on - adding mobile={false} doesn't help, and it's happening in Chrome and FireFox

wmertens avatar Jul 23 '18 14:07 wmertens