bgrins / spectrum

The No Hassle JavaScript Colorpicker
https://bgrins.github.io/spectrum/
MIT License
2.32k stars 588 forks source link

allowEmpty:true not working in Chrome #398

Closed cfator closed 8 years ago

cfator commented 8 years ago

Possibly other browsers too. Works in IE but in chrome the ability to choose the empty color is missing.

avoliva commented 8 years ago

Can you see it here?

Also, are you trying to set allowEmpty after initialization? There's a PR that fixes that here

cfator commented 8 years ago

Using those options when assigning spectrum to the inputs (after the dom is ready).
Was able to get around that by removing the && !isInoutColorType on line 240.

However now have a situation where the empty value is shown as black and getting the value returns black. -charlie

On Feb 26, 2016, at 2:41 PM, Adam Voliva notifications@github.com wrote:

Can you see it here?

Also, are you trying to set allowEmpty after initialization? There's a PR that fixes that here

— Reply to this email directly or view it on GitHub.

avoliva commented 8 years ago

Ah, right. inputs of type color cannot be allowed to be empty. Instead of modifying the spectrum code, just give your input a type of text.

cfator commented 8 years ago

Ah thank you sir, that was what I was missing.

On Fri, Feb 26, 2016 at 3:49 PM, Adam Voliva notifications@github.com wrote:

Ah, right. inputs of type color cannot be allowed to be empty. Instead of modifying the spectrum code, just give your input a type of text.

— Reply to this email directly or view it on GitHub https://github.com/bgrins/spectrum/issues/398#issuecomment-189494826.

bgrins commented 8 years ago

Thanks @avoliva for responding!