Coder Social home page Coder Social logo

Comments (5)

t1mmen avatar t1mmen commented on May 24, 2024 1

I'm also running into the last swatch not being selectable issue.

For those looking for a workaround: pass the color prop as HSL values instead of HEX.

Thank you for all your hard work, @casesandberg!

Edit

Per the swatches, it sounds like you would like to see the color is passed down in the center and the outside swatches + and - brightness of that color? Is that correct?

This is the behavior I expected as well, would love to see this implemented!

from react-color.

MFIMichael avatar MFIMichael commented on May 24, 2024

Just to add a bit more info to this: It seems to be when I add onChangeComplete and color to control the hex state in my component.

<ColorPicker type="slider" onChangeComplete={this.handleBackground} color={this.state.background} />

with

getInitialState(){
    return {
      background: '1861A9'
   };
},
handleBackground(swatch){
    this.setState({
      background: swatch.hex
    });
  },

so none of the 5 swatches are selected (whereas, with no props used the last swatch is usually selected). Selecting any of the first 4 swatches works normally. Selecting the last swatch WILL change the background state, but it will not 'select' the last swatch (ie, it grows in size briefly, then shrinks again as if not selected)

from react-color.

casesandberg avatar casesandberg commented on May 24, 2024

@MFIMichael thanks for more details about this!

Per the swatches, it sounds like you would like to see the color is passed down in the center and the outside swatches + and - brightness of that color? Is that correct?

As for the last swatch not being selectable, that is current a known problem with the color conversion library I am using at the moment. I am going to be switching to a different one here within the next few days which should fix the issue!

from react-color.

MFIMichael avatar MFIMichael commented on May 24, 2024

Thanks! And yes, my expectations are as you have described. :)

from react-color.

casesandberg avatar casesandberg commented on May 24, 2024

Going to track this in the v3.0.0 milestone to make sure it gets in there!

from react-color.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.