-
Notifications
You must be signed in to change notification settings - Fork 19
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
Bug: map pointer affects the hue pointer #20
Comments
It appears like |
I just discovered that if you try to input an rgb string in a textbox to set the color (bypassing the onChange prop), the background hue of the map, the map pointer, and the hue pointer do not change. For that to work, the code in |
Thanks for an excellent bug report and all the additional info! I'll take a look at this later today/tomorrow. |
You're right that when you drag the Map to black the hue slider changes. This is because there are many ways of representing black in hsl space and hsl to rgb conversion is lossy. The value is converted to rgb on the way out, so any black value will be Whilst it's not incorrect, it's definitely an annoyance. I'll take a look at fixing this. It may be that I have to ditch string as input and switch to an array of hsl values as suggested in #10.
I cannot reproduce the second bug. Here's a gif where I'm repeatedly clicking on the Map and the hue value does not change:
Hmm... This doesn't sound right. I've used this component in a situation where there was an accompanying text box for input and it worked fine. Perhaps create a codepen or fiddle or something and I can take a look? |
I looked at react-colorpicker and saw the following comment above
It sounds like he's using a hex string to combat the data loss issue. I should have been more specific about the 2nd bug. I was clicking random places on the map, not just the same place. My comment about the input was related to |
Steps to reproduce:
Another related bug:
It's very slight most of the time, but I've seen it vary by 4% if you just keep clicking. It's easier to see with a console.log().
Put this:
console.log(this.getPercentageValue(this.props.value))
inside of
getCss()
of Slider.jsThe text was updated successfully, but these errors were encountered: