luncheon / reinvented-color-wheel

A vanilla-js touch-friendly HSV color picker inspired by Farbtastic Color Picker.
https://luncheon.github.io/reinvented-color-wheel/
Do What The F*ck You Want To Public License
59 stars 4 forks source link

React Component - bug #19

Closed kachaj7 closed 2 years ago

kachaj7 commented 2 years ago

The React implementation doesn't work.

Updating color in input field launches onChange in the ReinventedColorWheel which makes a duplication. Second mistake is that, after second launch of the same function, the hex value contains new char on the end.

luncheon commented 2 years ago

I'm sorry, it's hard to understand the issue with just words for me. Could you reproduce it? It would be helpful if you could give me the URL using a web service such as CodeSandbox or StackBlitz. https://codesandbox.io/s/reinvented-color-wheel-react-9c9r7?file=/src/App.tsx

kachaj7 commented 2 years ago

https://codesandbox.io/s/reinvented-color-wheel-react-forked-olfuj?file=/src/App.tsx

Remove last f with backspace inside the input field, you will get then #ffff0f

luncheon commented 2 years ago

Hmm, sure. Incomplete hex values are not supported. And React fires the onChange callback on the "input" event.

How about this? https://codesandbox.io/s/reinvented-color-wheel-react-forked-hel4i?file=/src/App.tsx

kachaj7 commented 2 years ago

it can be as fix, thanks :)