Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active color does not set in Chrome #118

Open
JerrodV opened this issue Feb 16, 2016 · 4 comments
Open

Active color does not set in Chrome #118

JerrodV opened this issue Feb 16, 2016 · 4 comments

Comments

@JerrodV
Copy link

JerrodV commented Feb 16, 2016

This only happens in Chrome (48.0.2564.109 m)

If I use setColor() to set a color into the color picker, then open the color picker by clicking the button, the selected color is always black and not the value the button shows. A cancel click then sets black to the colorpicker despite it not being the last color set and a color that has never been set to the colorpicker. My colorpicker version is 1.1.8.

@JerrodV
Copy link
Author

JerrodV commented Feb 17, 2016

I was able to correct this issue by making a minor alteration to the library. It seems to work well for my use case, but I'd hope this would be properly evaluated by a team member before considering introducing the fix, since I am not sure what else it might effect. Note that in my case I am not using the colorpicker in in-line mode.

I've altered line (approx.) 2441 from:
that._setColor(that.inline || !that.element.is('input') ? that.options.color : that.element.val());

to:
that._setColor(!that.inline ? that.options.color : that.element.val());

This now sets the 'ui-colorpicker-map-pointer' to the proper color when the dialog is opened in IE(11.0.9600.18124), Chrome(48.0.2564.109 m) and FF(44.0.1). I will be testing this in Safari tomorrow and will post the results back here.

Also, if you for see this causing me any problems, I'd appreciate the heads up. I have not seen anything in my testing, but I'd rather be safe than sorry.

Thanks for a great widget.

@vanderlee
Copy link
Owner

Thanks for the report and possible fix. I'll look in to this issue.
It's weird that it would only show up in Chrome.

I can't seem to reproduce the issue with JSFiddle (http://jsfiddle.net/gt2hqsx0/3/) using Chrome 48.0.2564.109 m. Could you please take a look at the JSFiddle and tell me what I need to do in order to reproduce it?

@vanderlee
Copy link
Owner

Can you tell me if you're using the colorpicker inline or as a popup dialog?

@JerrodV
Copy link
Author

JerrodV commented Sep 21, 2016

If I understand the question correctly, the colorpicker is being used in popup mode. The user clicks a button and the color swatches are then chosen from a dialog. I have attached a couple images that hopefully better describe my use case.
On the left (of image1) I have a canvas and on the right, settings that apply to the objects in the canvas. When I select the object, I needed to set the current color of the object to the colorpicker, which shows correctly in the button. However, as in the second image, When the colorpicker opened, the selected color was always black. Keep in mind I just set the second image that way as my workaround seems to be holding up.

I looked at the fiddle, and the issue I'm seeing does not appear to be happening there. However, I am using a different call to set the color:'colorpicker.setColor(color);'.
I will try to find some time to see if I can repro the issue for you and then I'll get back to you. Thanks for taking interest.

image1
image2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants