react-color icon indicating copy to clipboard operation
react-color copied to clipboard

Disable Hex Input Autocomplete in ColorWrap

Open rafaelcorreiapoli opened this issue 9 years ago • 8 comments

Hello! I'm using SketchPicker When I type the hex color, it autocompletes... for example: If I type ccd it autocompletes to ccccdd, even before I had the chance to type the rest of hex code I wanted, let's say ccd912

How can I disable this behaviour ?

rafaelcorreiapoli avatar Feb 03 '17 19:02 rafaelcorreiapoli

I am also experiencing issues with this behaviour.

I'm using the TwitterPicker and closing it as soon as the user picks a color. The autocomplete behaviour causes the issue @rafaelcorreiapoli described when using the manual input.

I haven't found a good way to work around the issue, since I haven't seen any way to differentiate between when a user picked a color using the swatches and input the color using the text field.

lucaas avatar Mar 01 '17 10:03 lucaas

+1 on this.

I'm expecting users to type a hex color more often than using the few swatches on the <BlockPicker> and this module closing after 3 digits doesn't work for me. Especially when editing the the hex later closes after every change

Sparkmasterflex avatar Mar 02 '17 23:03 Sparkmasterflex

Ah, yes this is part of a bigger problem. All of the input box changes get pumped right into Tinycolor on every change: https://github.com/casesandberg/react-color/blob/master/src/helpers/color.js#L22

The inputs need to not be controlled by the actual state when they are in focus and replaced with the real value when blurred.

casesandberg avatar Mar 05 '17 06:03 casesandberg

Will this problem be fixed? I have the same one.

cjmafei avatar Jun 21 '19 06:06 cjmafei

@casesandberg why don't you provide a way to disable 3 digit hex values using this? https://github.com/casesandberg/react-color/blob/master/src/helpers/color.js#L47

shreshthmohan avatar Jun 22 '19 13:06 shreshthmohan

I have created a version with the fix here: https://github.com/shreshthmohan/react-color

I have made a PR too. #625 (currently a work in progress)

But those of you who wish to disallow 3 digit hex values can use my repo. ( @rafaelcorreiapoli @cjmafei @Sparkmasterflex @lucaas )

npm install shreshthmohan/react-color (or equivalent yarn command)

shreshthmohan avatar Jun 28 '19 04:06 shreshthmohan

I am interested in solving this as well. I wonder what are people thought about just disabling it?

Singwai avatar Jan 29 '21 17:01 Singwai

I am also currently working on this. Is there a solution yet?

amanrevvsales avatar Feb 23 '21 05:02 amanrevvsales