Closed kachaj7 closed 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
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
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
it can be as fix, thanks :)
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.