itsjavi / bootstrap-colorpicker

Bootstrap Colorpicker is a modular color picker plugin for Bootstrap.
https://itsjavi.com/bootstrap-colorpicker/
MIT License
1.38k stars 367 forks source link

Color picker always returning #000000 #265

Closed cheborneck closed 6 years ago

cheborneck commented 6 years ago

Description

{No matter what color I pick from a slider or the swatch, the value returned is always #000000 $('.bootstrap-colorpicker').colorpicker({ customClass: 'colorpicker-2x', useAlpha: false, format: 'hex/hex6', horizontal: false, sliders: { saturation: { maxLeft: 200, maxTop: 200 }, hue: { maxTop: 200 }, alpha: { maxTop: 200 } }, debug: true }); I tried the previous version which worked but didn't want the alpha slider which I guess you couldn't hide (hex only colors wanted).

COMMENT update: I was looking through your master branch announcement and noticed you switched over to use popper. I have found that popper is }

Context

Expected behavior

{Please write here}

Actual behavior

{Please write here}

Live Example

{Please write here a link to your JsFiddle example}

itsjavi commented 6 years ago

Hi, without a live example I cannot debug this properly. I see that you omited that part. Also:

SanderVanKeer commented 6 years ago

I have the same issue. If I post a field that uses the color picker the $_POST value is always "#000" for some reason. Any ideas?

ralison commented 6 years ago

I believe I am having the same issue here. In my case it appears to only be when the slider option is provided on initialisation.

I believe the same behavior is occurring on the example demo at ... https://farbelous.io/bootstrap-colorpicker/tutorial-CustomSize.html Note the color is not changing from the initial value

chamnap commented 6 years ago

Same here...

SanderVanKeer commented 6 years ago

I think I've found a solution. At first I did something like : $('.color-picker').colorpicker(); to initiate the colorpicker component on all elements with the class 'color-picker'.

I found out you actually need to do something like this: $('.color-picker').each(function() { $(this).parent().colorpicker(); });

itsjavi commented 6 years ago

I definitely want to investigate this. I hope I have time this week