React-color: Disable Hex Input Autocomplete in ColorWrap

Created on 3 Feb 2017  路  8Comments  路  Source: casesandberg/react-color

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 ?

help wanted

Most helpful comment

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.

All 8 comments

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.

+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

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.

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

@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

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)

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maximzah picture maximzah  路  5Comments

louh picture louh  路  4Comments

scottbarrow picture scottbarrow  路  6Comments

redguardtoo picture redguardtoo  路  4Comments

nevendyulgerov picture nevendyulgerov  路  3Comments