Search code examples
reactjsinputcolorsreact-color

How to create my own onChangeComplete function for input type color on React


With react-color https://casesandberg.github.io/react-color/ .
I can use ready-made onChangeComplete function from react-color.

But I wonder how can I create that onChangeComplete by using input type color tag. I tried onBlur but the color won't change until user clicks or presses tab

On the other hand, using onChange keep firing updates.
Because currently I'm using redux state, so dispatching update continuously when I drag and choose color isn't a good way.

Any ideas how to create onChangeComplete?


Solution

  • Here is the code that how react-color implemented onChangeComplete. It is hard coded using debounce.